ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/MinimizerParameterSet.hpp
Revision: 1002
Committed: Mon Feb 2 20:29:41 2004 UTC (20 years, 5 months ago) by tim
File size: 2157 byte(s)
Log Message:
Adding GoldenSection and Brent LineSearch Method

File Contents

# User Rev Content
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 1002 MinimizerParameterSet();
11     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 1002 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 tim 997
39 tim 1002 void setFTol(double tol) {fTol = tol;}
40     double getFTol() {return fTol;}
41 tim 997
42 tim 1002 void setGradTol(double tol) {gTol = tol;}
43     double getGradTol() {return gTol;}
44 tim 997
45 tim 1002 void setLineSearchTol(double tol) {lsTol = tol;}
46     double setLineSearchTol() {return lsTol;}
47    
48     void setLineSearchTol(int iter) {lsMaxIteration = iter;}
49     int setLineSearchTol() {return lsMaxIteration;}
50    
51     /*
52 tim 997 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 tim 1002 */
61 tim 997
62     protected:
63    
64 tim 1000 int maxIteration;
65 tim 1002 double stepTol;
66     double fTol;
67     double gTol;
68 tim 1000
69 tim 1002 int lsMaxIteration;
70     double lsTol;
71 tim 997
72 tim 1002 /*
73 tim 997 // 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 tim 1002 */
85 tim 997 };
86    
87    
88     #endif

Properties

Name Value
svn:executable *