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

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