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

File Contents

# User Rev Content
1 tim 969 #ifndef _CONJUGATEMINIMIZER_H_
2     #define _CONJUGATEMINIMIZER_H_
3    
4     #include "MinimizerBase.hpp"
5    
6 tim 1000 //abstract class of conjugate gradient minimizer
7 tim 1002 class ConjugateMinimizerBase : public Minimize{
8 tim 1000
9 tim 969 public:
10 tim 1000
11     ConjugateMinimizerBase(NLModel1* nlmodel);
12     ~ConjugateMinimizerBase();
13    
14 tim 969 bool isSolvable();
15 tim 1000 virtual void Init();
16     virtual void Minimize();
17     virtual int isConvergenceAchieved();
18 tim 987 virtual void reset();
19 tim 1000 virtual void printMinizerInfo();
20 tim 969
21     protected:
22 tim 1000
23     double calcGamma(vector<double>& newGrad, vector<double>& oldGrad) = 0;
24 tim 987 NLModel0 * model;
25 tim 1000
26     vector<double> prevGrad;
27     vector<double> gradient;
28     vector<double> prevDirection;
29     vector<double> direction;
30 tim 969 };
31    
32 tim 1000 //Fletcher-Reeves Conjugate Gradient Method
33     class FRCGMinimizer : public ConjugateMinimizerBase{
34 tim 969
35 tim 1000 protected:
36    
37     double calcGamma(vector<double>& newGrad, vector<double>& oldGrad);
38    
39 tim 969 };
40    
41 tim 1000 //Polak-Reeves Conjugate Gradient Method
42     class PRCGMinimizer : public ConjugateMinimizerBase{
43    
44     protected:
45    
46     double calcGamma(vector<double>& newGrad, vector<double>& oldGrad);
47 tim 969 };
48    
49     #endif