Bonmin 1.8.9
Loading...
Searching...
No Matches
BonBranchingTQP.hpp
Go to the documentation of this file.
1// (C) Copyright International Business Machines Corporation and
2// Carnegie Mellon University 2006, 2008
3// All Rights Reserved.
4// This code is published under the Eclipse Public License.
5//
6// Authors :
7// Andreas Waechter, International Business Machines Corporation
8// (derived from BonTMINLP2TNLP.hpp) 12/22/2006
9
10#ifndef __BONBRANCHINGTQP_HPP__
11#define __BONBRANCHINGTQP_HPP__
12
13#include "BonTMINLP2TNLP.hpp"
14
15namespace Bonmin
16{
26 {
27 public:
31
33 virtual ~BranchingTQP();
35
39 virtual bool get_nlp_info(Ipopt::Index& n, Ipopt::Index& m, Ipopt::Index& nnz_jac_g,
40 Ipopt::Index& nnz_h_lag, Ipopt::TNLP::IndexStyleEnum& index_style);
54 virtual bool get_starting_point(Ipopt::Index n, bool init_x, Ipopt::Number* x,
55 bool init_z, Ipopt::Number* z_L, Ipopt::Number* z_U,
56 Ipopt::Index m, bool init_lambda,
57 Ipopt::Number* lambda);
58
60 virtual bool eval_f(Ipopt::Index n, const Ipopt::Number* x, bool new_x,
61 Ipopt::Number& obj_value);
62
65 virtual bool eval_grad_f(Ipopt::Index n, const Ipopt::Number* x, bool new_x,
66 Ipopt::Number* grad_f);
67
69 virtual bool eval_g(Ipopt::Index n, const Ipopt::Number* x, bool new_x,
71
77 virtual bool eval_jac_g(Ipopt::Index n, const Ipopt::Number* x, bool new_x,
78 Ipopt::Index m, Ipopt::Index nele_jac, Ipopt::Index* iRow,
79 Ipopt::Index *jCol, Ipopt::Number* values);
80
88 virtual bool eval_h(Ipopt::Index n, const Ipopt::Number* x, bool new_x,
89 Ipopt::Number obj_factor, Ipopt::Index m, const Ipopt::Number* lambda,
90 bool new_lambda, Ipopt::Index nele_hess,
91 Ipopt::Index* iRow, Ipopt::Index* jCol, Ipopt::Number* values);
93 Ipopt::Index n, const Ipopt::Number* x, const Ipopt::Number* z_L, const Ipopt::Number* z_U,
94 Ipopt::Index m, const Ipopt::Number* g, const Ipopt::Number* lambda,
95 Ipopt::Number obj_value,
96 const Ipopt::IpoptData* ip_data,
99
103 {
104 return obj_val_;
105 }
107 {
108 return obj_grad_;
109 }
111 {
112 return obj_hess_;
113 }
115 {
116 return obj_hess_irow_;
117 }
119 {
120 return obj_hess_jcol_;
121 }
123 {
124 return g_vals_;
125 }
127 {
128 return g_jac_;
129 }
131 {
132 return g_jac_irow_;
133 }
135 {
136 return g_jac_jcol_;
137 }
139
140 private:
150 BranchingTQP();
151
154
156 void operator=(const BranchingTQP&);
158
162 Ipopt::Number obj_val_;
163 Ipopt::Number* obj_grad_;
164 Ipopt::Number* obj_hess_;
165 Ipopt::Index* obj_hess_irow_;
166 Ipopt::Index* obj_hess_jcol_;
167 Ipopt::Number* g_vals_;
168 Ipopt::Number* g_jac_;
169 Ipopt::Index* g_jac_irow_;
170 Ipopt::Index* g_jac_jcol_;
172
175 Ipopt::Index n_;
176 Ipopt::Index m_;
177 Ipopt::Index nnz_jac_g_;
178 Ipopt::Index nnz_h_lag_;
179 Ipopt::TNLP::IndexStyleEnum index_style_;
181
184 Ipopt::Number* x_sol_copy_;
185
188 Ipopt::Number* duals_sol_copy_;
189
192 Ipopt::SmartPtr<TMINLP2TNLP> tminlp2tnlp_;
193 };
194
195} // namespace Ipopt
196
197#endif
This is an adapter class that converts a TMINLP2TNLP object into a TNLP, which is now just a QP.
const Ipopt::Index * ConstrJacJCol()
virtual bool eval_f(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value)
Returns the value of the objective function in x.
virtual ~BranchingTQP()
Default destructor.
virtual void finalize_solution(Ipopt::SolverReturn status, Ipopt::Index n, const Ipopt::Number *x, const Ipopt::Number *z_L, const Ipopt::Number *z_U, Ipopt::Index m, const Ipopt::Number *g, const Ipopt::Number *lambda, Ipopt::Number obj_value, const Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq)
virtual bool get_nlp_info(Ipopt::Index &n, Ipopt::Index &m, Ipopt::Index &nnz_jac_g, Ipopt::Index &nnz_h_lag, Ipopt::TNLP::IndexStyleEnum &index_style)
virtual bool eval_jac_g(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Index nele_jac, Ipopt::Index *iRow, Ipopt::Index *jCol, Ipopt::Number *values)
Returns the jacobian of the constraints.
virtual bool eval_g(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g)
Returns the vector of constraint values in x.
BranchingTQP(Ipopt::SmartPtr< TMINLP2TNLP > tminlp2tnlp)
const Ipopt::Index * ConstrJacIRow()
const Ipopt::Index * ObjHessIRow()
const Ipopt::Number * ConstrJacVals()
const Ipopt::Number ObjVal()
Accessor Methods for QP data.
virtual bool get_constraints_linearity(Ipopt::Index m, LinearityType *const_types)
Returns the constraint linearity.
const Ipopt::Index * ObjHessJCol()
virtual bool get_starting_point(Ipopt::Index n, bool init_x, Ipopt::Number *x, bool init_z, Ipopt::Number *z_L, Ipopt::Number *z_U, Ipopt::Index m, bool init_lambda, Ipopt::Number *lambda)
Method called by Ipopt to get the starting point.
const Ipopt::Number * ObjHessVals()
virtual bool get_bounds_info(Ipopt::Index n, Ipopt::Number *x_l, Ipopt::Number *x_u, Ipopt::Index m, Ipopt::Number *g_l, Ipopt::Number *g_u)
const Ipopt::Number * ObjGrad()
virtual bool eval_h(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number obj_factor, Ipopt::Index m, const Ipopt::Number *lambda, bool new_lambda, Ipopt::Index nele_hess, Ipopt::Index *iRow, Ipopt::Index *jCol, Ipopt::Number *values)
Return the hessian of the lagrangian.
virtual bool eval_grad_f(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f)
Returns the vector of the gradient of the objective w.r.t.
const Ipopt::Number * ConstrRhs()
(C) Copyright International Business Machines Corporation 2007
ipindex Index
ipnumber Number