00001 #ifndef __F_FR_CgNonLS_H__ 00002 #define __F_FR_CgNonLS_H__ 00003 00004 00046 #include <stdio.h> 00047 #include "F_IterativeNonLS.hpp" 00048 00049 00050 class F_FR_CgNonLS : public F_IterativeNonLS 00051 { 00052 private: 00053 00054 double alpha; 00055 double beta; 00056 00057 FloatVector* r; 00058 FloatVector* d; 00059 00060 bool precondFlag; 00061 FloatVector* s; // used if Hessian Preconditioning is asked 00062 00063 double delta0; 00064 double deltaNew; 00065 double deltaOld; 00066 00067 protected: 00068 00069 virtual FloatVector* singleSolve(AbsFObjectiveFn* fn, FloatVector* x=0); 00070 00071 public: 00072 F_FR_CgNonLS(int maxIterations, double epsilon=1.0e-4):F_IterativeNonLS(maxIterations, epsilon) 00073 { r=d=s= 0; precondFlag=false;} 00074 virtual ~F_FR_CgNonLS(){} 00075 00076 virtual FloatVector* solve(AbsFObjectiveFn* fn, FloatVector* x=0); 00077 }; 00078 00079 #endif 00080