• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/tmp/buildd/coinor-ipopt-3.8.3/Ipopt/contrib/AsNMPC/examples/parametric_cpp/parametricTNLP.hpp

Go to the documentation of this file.
00001 // Copyright 2010 Hans Pirnay
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // Date   : 2010-01-05
00006 
00007 #ifndef __PARAMETRICTNLPEXAMPLE_HPP__
00008 #define __PARAMETRICTNLPEXAMPLE_HPP__
00009 
00010 #include "IpTNLP.hpp"
00011 
00012 namespace Ipopt
00013 {
00014   
00015   class ParametricTNLP : public TNLP
00016   {
00017   public:
00018 
00020     ParametricTNLP();
00021 
00023     virtual ~ParametricTNLP();
00024 
00028     virtual bool get_nlp_info(Index& n, Index& m, Index& nnz_jac_g,
00029                               Index& nnz_h_lag, IndexStyleEnum& index_style);
00030 
00032     virtual bool get_bounds_info(Index n, Number* x_l, Number* x_u,
00033                                  Index m, Number* g_l, Number* g_u);
00034 
00036     virtual bool get_starting_point(Index n, bool init_x, Number* x,
00037                                     bool init_z, Number* z_L, Number* z_U,
00038                                     Index m, bool init_lambda,
00039                                     Number* lambda);
00040 
00042     virtual bool eval_f(Index n, const Number* x, bool new_x, Number& obj_value);
00043 
00045     virtual bool eval_grad_f(Index n, const Number* x, bool new_x, Number* grad_f);
00046 
00048     virtual bool eval_g(Index n, const Number* x, bool new_x, Index m, Number* g);
00049 
00054     virtual bool eval_jac_g(Index n, const Number* x, bool new_x,
00055                             Index m, Index nele_jac, Index* iRow, Index *jCol,
00056                             Number* values);
00057 
00062     virtual bool eval_h(Index n, const Number* x, bool new_x,
00063                         Number obj_factor, Index m, const Number* lambda,
00064                         bool new_lambda, Index nele_hess, Index* iRow,
00065                         Index* jCol, Number* values);
00066 
00068 
00069     virtual bool get_var_con_metadata(Index n,
00070                                       StringMetaDataMapType& var_string_md,
00071                                       IntegerMetaDataMapType& var_integer_md,
00072                                       NumericMetaDataMapType& var_numeric_md,
00073                                       Index m,
00074                                       StringMetaDataMapType& con_string_md,
00075                                       IntegerMetaDataMapType& con_integer_md,
00076                                       NumericMetaDataMapType& con_numeric_md);    
00077     
00081     virtual void finalize_solution(SolverReturn status,
00082                                    Index n, const Number* x, const Number* z_L, const Number* z_U,
00083                                    Index m, const Number* g, const Number* lambda,
00084                                    Number obj_value,
00085                                    const IpoptData* ip_data,
00086                                    IpoptCalculatedQuantities* ip_cq);
00088 
00089   private:
00101     ParametricTNLP(const ParametricTNLP&);
00102     ParametricTNLP& operator=(const ParametricTNLP&);
00104 
00105 
00106     /* Nominal and perturbed parameter values */
00107     Number nominal_eta1_;
00108     Number nominal_eta2_;
00109 
00110     Number eta_1_perturbed_value_;
00111     Number eta_2_perturbed_value_;
00112   };
00113 
00114 }
00115 
00116 #endif

Generated on Thu Jul 29 2010 19:56:08 by  doxygen 1.7.1