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