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 1001 by tim, Fri Jan 30 21:47:22 2004 UTC vs.
Revision 1002 by tim, Mon Feb 2 20:29:41 2004 UTC

# Line 2 | Line 2
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 +    //initialize the minimizer method
19      virtual void Init() = 0;
14    virtual void Minimize() = 0;
15    virtual int isConvergenceAchieved() = 0;
16    
17    virtual bool isSolvable() = 0;
20  
21 <    virtual void printMinizerInfo() = 0;
21 >    //minimize the model
22 >    virtual void minimize() = 0;
23  
24 <    virtual MinimizerParameterSet* creatParameterSet() = 0;
25 <    
23 <    void setInitX(vector<double>& x) { initX = x;}
24 >    //
25 >    virtual int checkConvergence() = 0;
26  
27 <    void setMinX(vector<double>& x) { minX = x;}
28 <    vector<double> getMinX() { return minX;}
27 >    //check whether the model and the method are matched or not    
28 >    virtual bool isSolvable() = 0;
29  
30 <    void setPrecMinX(vector<double>& x) { prevMinX = x;}
29 <    vector<double> getPrevMinX() {return prevMinX;}
30 <
30 >    // get the final status of minimization
31      int getMinimizationStatus() {return minimizationStatus;}
32  
33 +    // get the name of minimization method
34      const string getName() {return minimizerName;}
35 +
36 +    //set the name of minimiation method
37      void setName(const string& name) { minimizerName = name;}
38  
36    
39    protected:
40      
41 <    MinimizerParameterSet* paramSet;
41 >    int minStatus;
42 >    string minimizerName;
43  
44 <    int minimizationStatus;
44 > };
45  
46 <    string minimizerName;
46 > class Minimizer : public MinimizerBase{
47 >
48 >  public:
49 >
50 >    virtual void printMinizerInfo() = 0;
51 >
52 >    virtual MinimizerParameterSet* creatParameterSet() = 0;
53 >    void setMinX(vector<double>& x) { minX = x;}
54 >    vector<double> getMinX() { return minX;}
55 >
56 >    void setPrevMinX(vector<double>& x) { prevMinX = x;}
57 >    vector<double> getPrevMinX() {return prevMinX;}
58 >
59 >    int getCurrentIteration() {return currentIter;}
60 >
61 >  protected:
62      
63 +    MinimizerParameterSet* paramSet;    
64 +    int currentIter;
65 +
66      // Coordinates yielding the minimum value of the function.
67      vector<double> minX;
68  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines