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

# Content
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 setLineSearchTol() {return lsTol;}
47
48 void setLineSearchTol(int iter) {lsMaxIteration = iter;}
49 int setLineSearchTol() {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

Properties

Name Value
svn:executable *