Go to the documentation of this file.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 #ifndef SUNDANCE_SUNDANCEMODELEVALUATORBASE_H
00032 #define SUNDANCE_SUNDANCEMODELEVALUATORBASE_H
00033
00034 #include "SundanceDefs.hpp"
00035
00036 #ifdef HAVE_SUNDANCE_MOOCHO
00037
00038 #include "Sundance.hpp"
00039 #include "Thyra_StateFuncModelEvaluatorBase.hpp"
00040
00041 namespace Thyra
00042 {
00043 using namespace Sundance;
00044 using namespace Sundance;
00045 using namespace Sundance;
00046 using namespace Sundance;
00047 using namespace Sundance;
00048 using namespace Teuchos;
00049
00050
00051
00052
00053 class SundanceModelEvaluator : public StateFuncModelEvaluatorBase<double>,
00054 public ObjectWithClassVerbosity<SundanceModelEvaluator>
00055 {
00056 public:
00057
00058 SundanceModelEvaluator(const VectorType<double>& vecType);
00059
00060
00061 virtual ~SundanceModelEvaluator() {;}
00062
00063
00064 RCP<const VectorSpaceBase<double> > get_x_space() const
00065 {return stateSpace().ptr();}
00066
00067
00068 RCP<const VectorSpaceBase<double> > get_f_space() const
00069 {return constraintSpace().ptr();}
00070
00071
00072 RCP<const VectorSpaceBase<double> > get_p_space(int i) const
00073 {
00074 TEST_FOR_EXCEPTION(i != 0, RuntimeError, "invalid index for parameter space");
00075 return paramSpace().ptr();
00076 }
00077
00078
00079 RCP<const VectorSpaceBase<double> > get_g_space(int i) const
00080 {
00081 TEST_FOR_EXCEPTION(i != 0, RuntimeError, "invalid index for objective space");
00082 return objectiveSpace_.ptr();
00083 }
00084
00085
00086 InArgs<double> getNominalValues() const;
00087
00088
00089 RCP<LinearOpBase<double> > create_W_op() const
00090 {return createW().ptr();}
00091
00092
00093 InArgs<double> createInArgs() const ;
00094
00095
00096 OutArgs<double> createOutArgsImpl() const ;
00097
00098
00099 void evalModelImpl(const InArgs<double>& inArgs,
00100 const OutArgs<double>& outArgs) const ;
00101
00102
00103
00104 virtual void internalEvalModel(const Vector<double>& stateVec,
00105 const Vector<double>& params,
00106 Vector<double>& resid,
00107 double& objFuncVal,
00108 LinearOperator<double>& df_dx,
00109 Array<Vector<double> >& df_dp,
00110 Vector<double>& dg_dp_T,
00111 Vector<double>& dg_dx_T) const = 0 ;
00112
00113
00114 virtual VectorSpace<double> paramSpace() const = 0;
00115
00116
00117 virtual VectorSpace<double> stateSpace() const = 0;
00118
00119
00120 virtual Vector<double> getInitialState() const = 0;
00121
00122
00123 virtual Vector<double> getInitialParameters() const = 0;
00124
00125
00126 virtual VectorSpace<double> constraintSpace() const = 0;
00127
00128
00129 virtual VectorSpace<double> objectiveSpace() const {return objectiveSpace_;}
00130
00131
00132 virtual LinearOperator<double> createW() const = 0;
00133
00134
00135 const VectorType<double>& vecType() const {return vecType_;}
00136
00137
00138
00139 private:
00140 VectorType<double> vecType_;
00141 VectorSpace<double> objectiveSpace_;
00142
00143 };
00144
00145 }
00146
00147
00148 #endif
00149
00150 #endif