00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef MyTNLP_HPP
00010 #define MyTNLP_HPP
00011 #include "TMINLP.hpp"
00012 using namespace Ipopt;
00027 class MyTMINLP : public TMINLP
00028 {
00029 public:
00031 MyTMINLP(){}
00032
00034 virtual ~MyTMINLP(){}
00035
00036
00038 MyTMINLP(const MyTMINLP &){}
00040
00041
00042
00049 virtual bool get_var_types(Index n, VariableType* var_types);
00050
00055 virtual bool get_constraints_types(Index m, ConstraintType* const_types);
00057
00070 virtual bool get_nlp_info(Index& n, Index&m, Index& nnz_jac_g,
00071 Index& nnz_h_lag, TNLP::IndexStyleEnum& index_style);
00072
00081 virtual bool get_bounds_info(Index n, Number* x_l, Number* x_u,
00082 Index m, Number* g_l, Number* g_u);
00083
00091 virtual bool get_starting_point(Index n, bool init_x, Number* x,
00092 bool init_z, Number* z_L, Number* z_U,
00093 Index m, bool init_lambda,
00094 Number* lambda);
00095
00103 virtual bool eval_f(Index n, const Number* x, bool new_x, Number& obj_value);
00104
00112 virtual bool eval_grad_f(Index n, const Number* x, bool new_x, Number* grad_f);
00113
00123 virtual bool eval_g(Index n, const Number* x, bool new_x, Index m, Number* g);
00124
00136 virtual bool eval_jac_g(Index n, const Number* x, bool new_x,
00137 Index m, Index nele_jac, Index* iRow, Index *jCol,
00138 Number* values);
00139
00151 virtual bool eval_h(Index n, const Number* x, bool new_x,
00152 Number obj_factor, Index m, const Number* lambda,
00153 bool new_lambda, Index nele_hess, Index* iRow,
00154 Index* jCol, Number* values);
00155
00156
00158 virtual void finalize_solution(SolverReturn status,
00159 Index n, const Number* x, Number obj_value) const;
00160
00162
00163 virtual const SosInfo * sosConstraints() const{return NULL;}
00164 virtual const BranchingInfo* branchingInfo() const{return NULL;}
00165 };
00166
00167 #endif