00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef ROOT_TQpSolverBase
00044 #define ROOT_TQpSolverBase
00045
00046 #ifndef ROOT_TError
00047 #include "TError.h"
00048 #endif
00049
00050 #ifndef ROOT_TQpVar
00051 #include "TQpVar.h"
00052 #endif
00053 #ifndef ROOT_TQpDataBase
00054 #include "TQpDataBase.h"
00055 #endif
00056 #ifndef ROOT_TQpResidual
00057 #include "TQpResidual.h"
00058 #endif
00059 #ifndef ROOT_TQpProbBase
00060 #include "TQpProbBase.h"
00061 #endif
00062 #ifndef ROOT_TQpLinSolverBase
00063 #include "TQpLinSolverBase.h"
00064 #endif
00065
00066 #ifndef ROOT_TMatrixD
00067 #include "TMatrixD.h"
00068 #endif
00069
00070
00071
00072
00073
00074
00075
00076 enum ETerminationCode
00077 {
00078 kSUCCESSFUL_TERMINATION = 0,
00079 kNOT_FINISHED,
00080 kMAX_ITS_EXCEEDED,
00081 kINFEASIBLE,
00082 kUNKNOWN
00083 };
00084
00085 class TQpSolverBase : public TObject
00086 {
00087
00088 protected:
00089 TQpLinSolverBase *fSys;
00090
00091 Double_t fDnorm;
00092
00093 Double_t fMutol;
00094 Double_t fArtol;
00095
00096 Double_t fGamma_f;
00097 Double_t fGamma_a;
00098 Double_t fPhi;
00099
00100 Int_t fMaxit;
00101
00102 Double_t *fMu_history;
00103 Double_t *fRnorm_history;
00104 Double_t *fPhi_history;
00105
00106 Double_t *fPhi_min_history;
00107
00108
00109 public:
00110 Int_t fIter;
00111
00112 TQpSolverBase();
00113 TQpSolverBase(const TQpSolverBase &another);
00114
00115 virtual ~TQpSolverBase();
00116
00117 virtual void Start (TQpProbBase *formulation,
00118 TQpVar *iterate,TQpDataBase *prob,
00119 TQpResidual *resid,TQpVar *step);
00120
00121 virtual void DefStart (TQpProbBase *formulation,
00122 TQpVar *iterate,TQpDataBase *prob,
00123 TQpResidual *resid,TQpVar *step);
00124
00125 virtual void SteveStart (TQpProbBase *formulation,
00126 TQpVar *iterate,TQpDataBase *prob,
00127 TQpResidual *resid,TQpVar *step);
00128
00129 virtual void DumbStart (TQpProbBase *formulation,
00130 TQpVar *iterate,TQpDataBase *prob,
00131 TQpResidual *resid,TQpVar *step);
00132
00133
00134
00135
00136
00137 virtual Int_t Solve (TQpDataBase *prob,TQpVar *iterate,
00138 TQpResidual *resids) = 0;
00139
00140
00141 virtual Double_t FinalStepLength
00142 (TQpVar *iterate,TQpVar *step);
00143
00144
00145 virtual void DoMonitor (TQpDataBase *data,TQpVar *vars,
00146 TQpResidual *resids,Double_t alpha,
00147 Double_t sigma,Int_t i,Double_t mu,
00148 Int_t stop_code,Int_t level);
00149
00150 virtual void DefMonitor (TQpDataBase *data,TQpVar *vars,
00151 TQpResidual *resids,Double_t alpha,
00152 Double_t sigma,Int_t i,Double_t mu,
00153 Int_t stop_code,Int_t level) = 0;
00154
00155
00156 virtual Int_t DoStatus (TQpDataBase *data,TQpVar *vars,
00157 TQpResidual *resids,Int_t i,Double_t mu,
00158 Int_t level);
00159
00160
00161 virtual Int_t DefStatus (TQpDataBase *data,TQpVar *vars,
00162 TQpResidual *resids,Int_t i,Double_t mu,
00163 Int_t level);
00164
00165
00166
00167 TQpLinSolverBase *GetLinearSystem() { return fSys; }
00168 void SetMuTol (Double_t m) { fMutol = m; }
00169 Double_t GetMuTol () { return fMutol; }
00170
00171 void SetArTol (Double_t ar) { fArtol = ar; }
00172 Double_t GetArTol () { return fArtol; }
00173 Double_t DataNorm () { return fDnorm; }
00174
00175 TQpSolverBase &operator= (const TQpSolverBase &source);
00176
00177 ClassDef(TQpSolverBase,1)
00178 };
00179 #endif