Bonmin  1.8.8
MyTMINLP.hpp
Go to the documentation of this file.
1 // (C) Copyright Carnegie Mellon University 2006
2 // All Rights Reserved.
3 // This code is published under the Eclipse Public License.
4 //
5 // Authors :
6 // P. Bonami, Carnegie Mellon University
7 //
8 // Date : 03/17/2006
9 #ifndef MyTNLP_HPP
10 #define MyTNLP_HPP
11 #include "BonTMINLP.hpp"
12 using namespace Ipopt;
13 using namespace Bonmin;
28 class MyTMINLP : public TMINLP
29 {
30 public:
33 printSol_(false){}
34 
36  virtual ~MyTMINLP(){}
37 
38 
40  MyTMINLP(const MyTMINLP &other):
41 printSol_(other.printSol_){}
43  //MyTMINLP& operator=(const MyTMINLP&) {}
44 
45 
52  virtual bool get_variables_types(Index n, VariableType* var_types);
53 
55  virtual bool get_variables_linearity(Index n, Ipopt::TNLP::LinearityType* var_types);
56 
61  virtual bool get_constraints_linearity(Index m, Ipopt::TNLP::LinearityType* const_types);
63 
76  virtual bool get_nlp_info(Index& n, Index&m, Index& nnz_jac_g,
77  Index& nnz_h_lag, TNLP::IndexStyleEnum& index_style);
78 
87  virtual bool get_bounds_info(Index n, Number* x_l, Number* x_u,
88  Index m, Number* g_l, Number* g_u);
89 
97  virtual bool get_starting_point(Index n, bool init_x, Number* x,
98  bool init_z, Number* z_L, Number* z_U,
99  Index m, bool init_lambda,
100  Number* lambda);
101 
109  virtual bool eval_f(Index n, const Number* x, bool new_x, Number& obj_value);
110 
118  virtual bool eval_grad_f(Index n, const Number* x, bool new_x, Number* grad_f);
119 
129  virtual bool eval_g(Index n, const Number* x, bool new_x, Index m, Number* g);
130 
142  virtual bool eval_jac_g(Index n, const Number* x, bool new_x,
143  Index m, Index nele_jac, Index* iRow, Index *jCol,
144  Number* values);
145 
157  virtual bool eval_h(Index n, const Number* x, bool new_x,
158  Number obj_factor, Index m, const Number* lambda,
159  bool new_lambda, Index nele_hess, Index* iRow,
160  Index* jCol, Number* values);
161 
162 
164  virtual void finalize_solution(TMINLP::SolverReturn status,
165  Index n, const Number* x, Number obj_value);
166 
168 
169  virtual const SosInfo * sosConstraints() const{return NULL;}
170  virtual const BranchingInfo* branchingInfo() const{return NULL;}
171 
172 
174  printSol_ = true;}
175 
176 private:
177  bool printSol_;
178 };
179 
180 #endif
Base class for all MINLPs that use a standard triplet matrix form and dense vectors.
Definition: BonTMINLP.hpp:59
MyTMINLP()
Default constructor.
Definition: MyTMINLP.hpp:32
virtual ~MyTMINLP()
virtual destructor.
Definition: MyTMINLP.hpp:36
Class to store sos constraints for model.
Definition: BonTMINLP.hpp:72
SolverReturn
Return statuses of algorithm.
Definition: BonTMINLP.hpp:64
A C++ example for interfacing an MINLP with bonmin.
Definition: MyTMINLP.hpp:28
virtual const SosInfo * sosConstraints() const
Definition: MyTMINLP.hpp:169
void printSolutionAtEndOfAlgorithm()
Definition: MyTMINLP.hpp:173
bool printSol_
Definition: MyTMINLP.hpp:177
Stores branching priorities information.
Definition: BonTMINLP.hpp:111
MyTMINLP(const MyTMINLP &other)
Copy constructor.
Definition: MyTMINLP.hpp:40
virtual const BranchingInfo * branchingInfo() const
Definition: MyTMINLP.hpp:170