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