ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/minimizers/MinimizerParameterSet.hpp
(Generate patch)

Comparing branches/new_design/OOPSE-3.0/src/minimizers/MinimizerParameterSet.hpp (file contents):
Revision 1826 by tim, Thu Dec 2 05:04:20 2004 UTC vs.
Revision 1900 by tim, Tue Jan 4 22:18:06 2005 UTC

# Line 1 | Line 1
1 < #ifndef _MININIZERPARAMETERSET_H_
1 > #ifndef MINIMIZERS_MININIZERPARAMETERSET_HPP
2 > #define MINIMIZERS_MININIZERPARAMETERSET_HPP
3 > #include "brains/SimInfo.hpp"
4 > namespace oopse {
5  
3 #define _MININIZERPARAMETERSET_H_
4
5
6
7 const double DEFAULTTOLERANCE = 1.0e-8;
8
9
10
6   // base class of minimizer's parameter set
7  
8 < class MinimizerParameterSet{
8 > class MinimizerParameterSet {
9 >    public:
10  
11 <  public:
11 >        MinimizerParameterSet(SimInfo* info);
12  
13 +        void setDefaultParameter();
14  
15 +        void setStepTol(double tol) {
16 +            stepTol = tol;
17 +        }
18  
19 <    MinimizerParameterSet() {setDefaultParameter();}
19 >        double getStepTol() {
20 >            return stepTol;
21 >        }
22  
23 <    MinimizerParameterSet(MinimizerParameterSet& param) {*this = param;}
23 >        void setStepSize(double size) {
24 >            stepSize = size;
25 >        }
26  
27 <    
27 >        double getStepSize() {
28 >            return stepSize;
29 >        }
30  
31 <    void operator= (MinimizerParameterSet& param) {
31 >        void setMaxIteration(int iter) {
32 >            maxIteration = iter;
33 >        }
34  
35 +        int getMaxIteration() {
36 +            return maxIteration;
37 +        }
38  
39 +        void setFTol(double tol) {
40 +            fTol = tol;
41 +        }
42  
43 <      maxIteration = param.maxIteration;
43 >        double getFTol() {
44 >            return fTol;
45 >        }
46  
47 <      stepSize = param.stepSize;
47 >        void setGTol(double tol) {
48 >            gTol = tol;
49 >        }
50  
51 <      stepTol = param.stepTol;
51 >        double getGTol() {
52 >            return gTol;
53 >        }
54  
55 <      fTol = param.fTol;
55 >        void setLineSearchTol(double tol) {
56 >            lsTol = tol;
57 >        }
58  
59 <      gTol = param.gTol;
59 >        double getLineSearchTol() {
60 >            return lsTol;
61 >        }
62  
63 +        void setLineSearchMaxIteration(int iter) {
64 +            lsMaxIteration = iter;
65 +        }
66  
67 +        int getLineSearchMaxIteration() {
68 +            return lsMaxIteration;
69 +        }
70  
71 <      writeFrq = param.writeFrq;
71 >        void setWriteFrq(int frq) {
72 >            writeFrq = frq;
73 >        }
74  
75 +        int getWriteFrq() {
76 +            return writeFrq;
77 +        }
78  
79 +    protected:
80  
81 <      lsMaxIteration = param.lsMaxIteration;
81 >        int maxIteration;
82  
83 <      lsTol = param.lsTol;
83 >        double stepTol;
84  
85 +        double fTol;
86  
87 +        double gTol;
88  
89 < }
89 >        double stepSize;
90  
91 <    
91 >        int lsMaxIteration;
92  
93 <    virtual void setDefaultParameter(){
93 >        double lsTol;
94  
95 <      maxIteration = 200;
95 >        int writeFrq;
96  
97 <      stepSize = 0.01;
97 >        static const double  defaultTolerance = 1.0e-8;
98  
61      stepTol = DEFAULTTOLERANCE;
62
63      fTol = DEFAULTTOLERANCE;
64
65      gTol = DEFAULTTOLERANCE;
66
67
68
69      writeFrq = maxIteration;
70
71      
72
73      lsMaxIteration = 50;
74
75      lsTol = DEFAULTTOLERANCE;
76
77    }
78
79      
80
81    void setStepTol(double tol) { stepTol = tol;}
82
83    double getStepTol() { return stepTol;}
84
85
86
87    void setStepSize(double size) {  stepSize = size;}
88
89    double getStepSize() { return stepSize;}
90
91
92
93    void setMaxIteration(int iter) { maxIteration = iter;}
94
95    int getMaxIteration() {return maxIteration;}
96
97
98
99    void setFTol(double tol) {fTol = tol;}
100
101    double getFTol() {return fTol;}
102
103
104
105    void setGTol(double tol) {gTol = tol;}
106
107    double getGTol() {return gTol;}
108
109
110
111    void setLineSearchTol(double tol) {lsTol = tol;}
112
113    double getLineSearchTol() {return lsTol;}
114
115
116
117    void setLineSearchMaxIteration(int iter) {lsMaxIteration = iter;}
118
119    int getLineSearchMaxIteration() {return lsMaxIteration;}
120
121
122
123    void setWriteFrq(int frq) {writeFrq = frq;}
124
125    int getWriteFrq() {return writeFrq;}
126
127
128
129  protected:    
130
131
132
133    int maxIteration;
134
135    double stepTol;
136
137    double fTol;
138
139    double gTol;
140
141    double stepSize;
142
143
144
145    int lsMaxIteration;
146
147    double lsTol;
148
149
150
151    int writeFrq;
152
153    //int resetFrq;
154
155 /*
156
157    // Absolute tolerance
158
159     std::vector<double> absTol;
160
161
162
163    // Relative tolerance
164
165     std::vector<double> relTol;
166
167
168
169    // Total specified tolerance at convergence
170
171     std::vector<double> totTol;
172
173
174
175    // Tolerance achieved at convergence.
176
177     std::vector<double> achTol;
178
179 */
180
99   };
100  
101 <
184 <
185 <
186 <
101 > }
102   #endif
188

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines