ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/ConjugateMinimizer.hpp
Revision: 1015
Committed: Tue Feb 3 22:54:52 2004 UTC (20 years, 5 months ago) by tim
File size: 1237 byte(s)
Log Message:
NLModel0, NLModel1 pass uit test

File Contents

# User Rev Content
1 tim 969 #ifndef _CONJUGATEMINIMIZER_H_
2     #define _CONJUGATEMINIMIZER_H_
3    
4 tim 1015 #include "Minimizer.hpp"
5 tim 969
6 tim 1000 //abstract class of conjugate gradient minimizer
7 tim 1010 class ConjugateMinimizerBase : public MinimizerUsingLineSearch{
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 tim 1010 virtual int checkConvergence();
18 tim 987 virtual void reset();
19 tim 1000 virtual void printMinizerInfo();
20 tim 1015 virtual void writeOut(vector<double>& x, double iter) {}
21 tim 969
22     protected:
23 tim 1000
24 tim 1015 virtual double calcGamma(vector<double>& newGrad, vector<double>& oldGrad) = 0;
25 tim 987 NLModel0 * model;
26 tim 1000
27     vector<double> prevGrad;
28     vector<double> gradient;
29     vector<double> prevDirection;
30     vector<double> direction;
31 tim 969 };
32    
33 tim 1000 //Fletcher-Reeves Conjugate Gradient Method
34     class FRCGMinimizer : public ConjugateMinimizerBase{
35 tim 969
36 tim 1000 protected:
37    
38     double calcGamma(vector<double>& newGrad, vector<double>& oldGrad);
39    
40 tim 969 };
41    
42 tim 1000 //Polak-Reeves Conjugate Gradient Method
43     class PRCGMinimizer : public ConjugateMinimizerBase{
44    
45     protected:
46    
47     double calcGamma(vector<double>& newGrad, vector<double>& oldGrad);
48 tim 969 };
49    
50     #endif