1 |
#ifndef _MININIZERPARAMETERSET_H_
|
2 |
#define _MININIZERPARAMETERSET_H_
|
3 |
|
4 |
const double DEFAULTTOLERANCE = 1.0e-4;
|
5 |
|
6 |
// base class of minimizer's parameter set
|
7 |
class MinimizerParameterSet{
|
8 |
public:
|
9 |
|
10 |
MinimizerParameterSet();
|
11 |
MinimizerParameterSet(MinimizerParameterSet& param) {*this = param;}
|
12 |
|
13 |
void operator= (MinimizerParameterSet& param) {
|
14 |
|
15 |
maxIteration = param.maxIteration;
|
16 |
stepTol = param.stepTol;
|
17 |
lsTol = param.lsTol;
|
18 |
fTol = param.fTol;
|
19 |
gTol = param.gTol;
|
20 |
}
|
21 |
|
22 |
virtual void setDefaultParameter(){
|
23 |
maxIteration = 200;
|
24 |
stepTol = DEFAULTTOLERANCE;
|
25 |
fTol = DEFAULTTOLERANCE;
|
26 |
gTol = DEFAULTTOLERANCE;
|
27 |
|
28 |
lsMaxIteration = 50;
|
29 |
lsTol = 1.0e-4;
|
30 |
}
|
31 |
|
32 |
|
33 |
void setStepTol(double tol) { stepTol = tol;}
|
34 |
double getStepTol() { return stepTol;}
|
35 |
|
36 |
void setMaxIteration(int iter) { maxIteration = iter;}
|
37 |
int getMaxIteration() {return maxIteration;}
|
38 |
|
39 |
void setFTol(double tol) {fTol = tol;}
|
40 |
double getFTol() {return fTol;}
|
41 |
|
42 |
void setGradTol(double tol) {gTol = tol;}
|
43 |
double getGradTol() {return gTol;}
|
44 |
|
45 |
void setLineSearchTol(double tol) {lsTol = tol;}
|
46 |
double getLineSearchTol() {return lsTol;}
|
47 |
|
48 |
void setLineSearchMaxIteration(int iter) {lsMaxIteration = iter;}
|
49 |
int getLineSearchMaxIteration() {return lsMaxIteration;}
|
50 |
|
51 |
/*
|
52 |
void setAbsTol(vector<double>& tol) { absTol = tol;}
|
53 |
vector<double> getAbsTol() { return absTol;}
|
54 |
|
55 |
void setRelTol(vector<double> tol) { relTol = tol;}
|
56 |
vector<double> getRelTol() { return relTol;}
|
57 |
|
58 |
void setTotTol(vector<double>& tol) { totTol = tol;}
|
59 |
vector<double> getTotTol() { return totTol;}
|
60 |
*/
|
61 |
|
62 |
protected:
|
63 |
|
64 |
int maxIteration;
|
65 |
double stepTol;
|
66 |
double fTol;
|
67 |
double gTol;
|
68 |
|
69 |
int lsMaxIteration;
|
70 |
double lsTol;
|
71 |
|
72 |
/*
|
73 |
// Absolute tolerance
|
74 |
vector<double> absTol;
|
75 |
|
76 |
// Relative tolerance
|
77 |
vector<double> relTol;
|
78 |
|
79 |
// Total specified tolerance at convergence
|
80 |
vector<double> totTol;
|
81 |
|
82 |
// Tolerance achieved at convergence.
|
83 |
vector<double> achTol;
|
84 |
*/
|
85 |
};
|
86 |
|
87 |
|
88 |
#endif
|