Actual source code: lmvmmat.h
1: #ifndef LMVMMAT_H
2: #define LMVMMAT_H
4: #include "taomat.h"
6: class TaoLMVMMat: public TaoMat {
8: protected:
9: int lm;
10: double eps;
12: int limitType; // Limit type on change in scaling matrix
13: int scaleType; // Scaling type (scalar or broyden)
14: int rScaleType; // Additional rescaling to use for diagonal
16: double s_alpha; // Factor for scalar scaling
17: double r_alpha; // Factor on scalar for rescaling diagonal matrix
18: double r_beta; // Factor on diagonal for rescaling diagonal matrix
19: double mu; // Factor for using historical information
20: double nu; // Factor for using historical information
21: double phi; // Factor for Broyden scaling
23: int scalar_history; // Amount of history to keep for scalar scaling
24: double *yy_history; // Past information for scalar scaling
25: double *ys_history; // Past information for scalar scaling
26: double *ss_history; // Past information for scalar scaling
28: int rescale_history; // Amount of history to keep for rescaling diagonal
29: double *yy_rhistory; // Past information for scalar rescaling
30: double *ys_rhistory; // Past information for scalar rescaling
31: double *ss_rhistory; // Past information for scalar rescaling
33: double delta_max; // Maximum value for delta
34: double delta_min; // Minimum value for delta
36: int lmnow;
37: int iter;
38: int updates;
39: int rejects;
41: TaoVec **S;
42: TaoVec **Y;
43: TaoVec *Gprev;
44: TaoVec *Xprev;
46: TaoVec *D;
47: TaoVec *U;
48: TaoVec *V;
49: TaoVec *W;
50: TaoVec *P;
51: TaoVec *Q;
53: double delta;
54: double sigma;
55: double *rho;
56: double *beta;
58: TaoTruth H0default;
59: TaoMat *H0;
61: TaoVec *scale;
63: public:
64:
65: TaoLMVMMat(TaoVec *);
66: ~TaoLMVMMat();
68: int Reset();
69: int Presolve();
70: int Solve(TaoVec *, TaoVec *, TaoTruth *);
71: int Update(TaoVec *, TaoVec *);
73: int View();
75: int SetDelta(double);
76: int SetScale(TaoVec *s);
78: inline int GetRejects() { return(rejects); }
80: int SetH0(TaoMat *HH0);
81: int GetX0(TaoVec *x);
82: int InitialApproximation(TaoVec *x);
84: int Refine(TaoLMVMMat *coarse, TaoMat *op, TaoVec *fineX, TaoVec *fineG);
85: };
87: #endif