ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/MinimizerParameterSet.hpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/MinimizerParameterSet.hpp (file contents):
Revision 997 by tim, Thu Jan 29 21:44:13 2004 UTC vs.
Revision 1031 by tim, Fri Feb 6 18:58:06 2004 UTC

# Line 1 | Line 1
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:
7    MinimizerParameterSet(int dim);
9  
10 <    virtual void setDefaultParameter();
10 >    MinimizerParameterSet() {setDefaultParameter();}
11 >    MinimizerParameterSet(MinimizerParameterSet& param) {*this = param;}
12      
13 <    void setStepSize(double step) { stepSize = step;}
12 <    double getStepSize() { return stepSize;}
13 >    void operator= (MinimizerParameterSet& param) {
14  
15 <    void setMaxStep(double step) { maxStep = step;}
16 <    double getMaxStep() {return maxStep;}
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 <    const string getMethodName() {return methodName;}
29 <    void setMethodName(const string& name) { methodName = name;}
28 >      writeFrq = maxIteration;
29 >      resetFrq = maxIteration;
30 >      
31 >      lsMaxIteration = 50;
32 >      lsTol = 1.0e-4;
33 >    }
34 >      
35 >    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  
41 <    void setAbsGradTol(double tol) {absGradTol = tol;}
42 <    double getAbsGradTol() {return absGradTol;}
41 >    void setFTol(double tol) {fTol = tol;}
42 >    double getFTol() {return fTol;}
43  
44 <    void setAchGradTol(double tol) { absAchGradTol = tol;}
45 <    double getAchGradTol() { return achGradTol;}
44 >    void setGTol(double tol) {gTol = tol;}
45 >    double getGTol() {return gTol;}
46  
47 +    void setLineSearchTol(double tol) {lsTol = tol;}
48 +    double getLineSearchTol() {return lsTol;}
49 +
50 +    void setLineSearchMaxIteration(int iter) {lsMaxIteration = iter;}
51 +    int getLineSearchMaxIteration() {return lsMaxIteration;}
52 +
53 +    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 + /*
60      void setAbsTol(vector<double>& tol) { absTol = tol;}
61      vector<double> getAbsTol() { return absTol;}
62      
# Line 31 | Line 65 | class MinimizerParameterSet{
65  
66      void setTotTol(vector<double>& tol) { totTol = tol;}
67      vector<double> getTotTol() { return totTol;}
68 + */
69  
70    protected:    
71  
72 <    double stepSize;
73 <    double maxStep;
72 >    int maxIteration;
73 >    double stepTol;
74 >    double fTol;
75 >    double gTol;
76  
77 <    // Name of minimizer
78 <    string methodName;
77 >    int lsMaxIteration;
78 >    double lsTol;
79  
80 <    // Absolute gradient tolerance
81 <    double absGradTol;
82 <
46 <   // Achieved gradient tolerance.
47 <    double  achGradTol;
48 <
80 >    int writeFrq;
81 >    int resetFrq;
82 > /*
83      // Absolute tolerance
84      vector<double> absTol;
85  
# Line 57 | Line 91 | class MinimizerParameterSet{
91  
92      // Tolerance achieved at convergence.
93      vector<double> achTol;
94 <
94 > */
95   };
96  
97  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines