- Main Page
- Classes
- Files

- File List
- File Members

# examples/Cpp_example/MyNLP.hpp

Go to the documentation of this file.

    00001 // Copyright (C) 2004, 2006 International Business Machines and others.
    00002 // All Rights Reserved.
    00003 // This code is published under the Eclipse Public License.
    00004 //
    00005 // $Id: MyNLP.hpp 1861 2010-12-21 21:34:47Z andreasw $
    00006 //
    00007 // Authors:  Carl Laird, Andreas Waechter     IBM    2004-11-05
    00008
    00009 #ifndef __MYNLP_HPP__
    00010 #define __MYNLP_HPP__
    00011
    00012 #include "IpTNLP.hpp"
    00013
    00014 using namespace Ipopt;
    00015
    00028 class MyNLP : public TNLP
    00029 {
    00030 public:
    00032   MyNLP();
    00033
    00035   virtual ~MyNLP();
    00036
    00040   virtual bool get_nlp_info(Index& n, Index& m, Index& nnz_jac_g,
    00041                             Index& nnz_h_lag, IndexStyleEnum& index_style);
    00042
    00044   virtual bool get_bounds_info(Index n, Number* x_l, Number* x_u,
    00045                                Index m, Number* g_l, Number* g_u);
    00046
    00048   virtual bool get_starting_point(Index n, bool init_x, Number* x,
    00049                                   bool init_z, Number* z_L, Number* z_U,
    00050                                   Index m, bool init_lambda,
    00051                                   Number* lambda);
    00052
    00054   virtual bool eval_f(Index n, const Number* x, bool new_x, Number& obj_value);
    00055
    00057   virtual bool eval_grad_f(Index n, const Number* x, bool new_x, Number* grad_f);
    00058
    00060   virtual bool eval_g(Index n, const Number* x, bool new_x, Index m, Number* g);
    00061
    00066   virtual bool eval_jac_g(Index n, const Number* x, bool new_x,
    00067                           Index m, Index nele_jac, Index* iRow, Index *jCol,
    00068                           Number* values);
    00069
    00074   virtual bool eval_h(Index n, const Number* x, bool new_x,
    00075                       Number obj_factor, Index m, const Number* lambda,
    00076                       bool new_lambda, Index nele_hess, Index* iRow,
    00077                       Index* jCol, Number* values);
    00078
    00080
    00084   virtual void finalize_solution(SolverReturn status,
    00085                                  Index n, const Number* x, const Number* z_L, const Number* z_U,
    00086                                  Index m, const Number* g, const Number* lambda,
    00087                                  Number obj_value,
    00088                  const IpoptData* ip_data,
    00089                  IpoptCalculatedQuantities* ip_cq);
    00091
    00092 private:
    00104   //  MyNLP();
    00105   MyNLP(const MyNLP&);
    00106   MyNLP& operator=(const MyNLP&);
    00108 };
    00109
    00110
    00111 #endif

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines