00001 #ifndef __F_HS_CgNonLS_H__ 00002 #define __F_HS_CgNonLS_H__ 00003 00004 00037 #include <stdio.h> 00038 #include "F_IterativeNonLS.hpp" 00039 00040 00041 class F_HS_CgNonLS : public F_IterativeNonLS 00042 { 00043 private: 00044 00045 double alpha; 00046 double beta; 00047 00048 FloatVector* r; 00049 FloatVector* d; 00050 FloatVector* y; 00051 00052 bool precondFlag; 00053 FloatVector* s; // used if Hessian Preconditioning is asked 00054 00055 double delta0; 00056 double deltaNew; 00057 double deltaOld; 00058 00059 protected: 00060 00061 virtual FloatVector* singleSolve(AbsFObjectiveFn* fn, FloatVector* x=0); 00062 00063 public: 00064 F_HS_CgNonLS(int maxIterations, double epsilon=1.0e-4):F_IterativeNonLS(maxIterations, epsilon) 00065 { r=d=y=s= 0; precondFlag=true;} 00066 virtual ~F_HS_CgNonLS(){} 00067 00068 virtual FloatVector* solve(AbsFObjectiveFn* fn, FloatVector* x=0); 00069 }; 00070 00071 #endif 00072