00001 #ifndef NONLINEARPROBLEM_H 00002 #define NONLINEARPROBLEM_H 00003 00004 #include "SundanceDefs.h" 00005 #include "StaticLinearProblem.h" 00006 00007 00008 namespace Sundance 00009 { 00010 00011 using namespace TSF; 00012 using std::string; 00013 00014 using std::ostream; 00015 00016 /** \ingroup UserLevelFE 00017 */ 00018 00019 class NonlinearProblem : public TSFNonlinearOperatorBase 00020 { 00021 public: 00022 /** */ 00023 NonlinearProblem(); 00024 /** */ 00025 NonlinearProblem(const StaticLinearProblem& linearizedProblem, 00026 const Expr& guess, 00027 const TSFLinearSolver& solver); 00028 /** */ 00029 virtual ~NonlinearProblem(){;} 00030 00031 /** apply the operator to a vector. */ 00032 virtual void apply(const TSFVector& arg, TSFVector& out) const ; 00033 00034 /** get a linear operator representing the derivative at an eval point */ 00035 virtual TSFLinearOperator derivative(const TSFVector& evalPt) const ; 00036 00037 /** write to a stream */ 00038 virtual void print(ostream& os) const ; 00039 00040 private: 00041 StaticLinearProblem linearizedProblem_; 00042 00043 TSFLinearSolver solver_; 00044 00045 Expr guess_; 00046 }; 00047 00048 00049 } 00050 #endif