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

Comparing trunk/OOPSE/libmdtools/MinimizerBase.hpp (file contents):
Revision 970 by tim, Tue Jan 20 20:34:12 2004 UTC vs.
Revision 1002 by tim, Mon Feb 2 20:29:41 2004 UTC

# Line 1 | Line 1
1   #ifndef _MINIMIZERBASE_H_
2   #define _MINIMIZERBASE_H_
3  
4 + #include <string>
5 + #include <vector>
6 +
7 + #include "MinimizerParameterSet.hpp"
8 +
9 + #define MINSTATUS_ERROR -1
10 + #define MINSTATUS_CONVERGE 0
11 + #define MINSTATUS_MAXITER 1
12 +
13 + using namespace std;
14 +
15   class MinimizerBase{
16    public:
17  
18 <    virtual void Minimize() = 0;
19 <    virtual int step() = 0;
9 <    virtual bool testConvergence() = 0;
18 >    //initialize the minimizer method
19 >    virtual void Init() = 0;
20  
21 +    //minimize the model
22 +    virtual void minimize() = 0;
23 +
24 +    //
25 +    virtual int checkConvergence() = 0;
26 +
27 +    //check whether the model and the method are matched or not    
28      virtual bool isSolvable() = 0;
29  
30 <    void double setFTol(double tol);
31 <    void double setGradTol(double gradTol);
30 >    // get the final status of minimization
31 >    int getMinimizationStatus() {return minimizationStatus;}
32  
33 <    void setStepSize(double step);
34 <    double getStepSize();
33 >    // get the name of minimization method
34 >    const string getName() {return minimizerName;}
35  
36 <    void setMaxStep();
37 <    double getMaxStep();
36 >    //set the name of minimiation method
37 >    void setName(const string& name) { minimizerName = name;}
38  
39 <    const string& getMethodName();
40 <    void setMethodName(const string& name);
39 >  protected:
40 >    
41 >    int minStatus;
42 >    string minimizerName;
43  
44 <    void setObjFunctor();
26 <    void getObjFunctor();
44 > };
45  
46 < /*
29 <    void setUpdateFunctor();
30 <    void getUpdateFunctor();
46 > class Minimizer : public MinimizerBase{
47  
48 <    void setSearchFunctor();
33 <    void getSearchFunctor();
34 < */
48 >  public:
49  
50 <  protected:
50 >    virtual void printMinizerInfo() = 0;
51  
52 <    double stepSize;
53 <    double maxStep;
54 <    double fTol;
41 <    double gradTol;
42 <    string methodName;
52 >    virtual MinimizerParameterSet* creatParameterSet() = 0;
53 >    void setMinX(vector<double>& x) { minX = x;}
54 >    vector<double> getMinX() { return minX;}
55  
56 <    bool hasObjFunctor;
56 >    void setPrevMinX(vector<double>& x) { prevMinX = x;}
57 >    vector<double> getPrevMinX() {return prevMinX;}
58  
59 < /*
47 <    bool hasUpdateFunctor;
59 >    int getCurrentIteration() {return currentIter;}
60  
61 <    bool hasSearchFunctor;
62 < */
61 >  protected:
62 >    
63 >    MinimizerParameterSet* paramSet;    
64 >    int currentIter;
65  
66 +    // Coordinates yielding the minimum value of the function.
67 +    vector<double> minX;
68 +
69 +   // Vector holding the previous point.
70 +    vector<double> prevMinX;
71   };
72   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines