#include <BonTMINLPLinObj.hpp>
Inheritance diagram for Bonmin::TMINLPLinObj:
Public Member Functions | |
TMINLPLinObj () | |
Default constructor. | |
virtual | ~TMINLPLinObj () |
destructor. | |
void | setTminlp (SmartPtr< TMINLP > tminlp) |
set reference TMINLP | |
virtual bool | get_variables_linearity (Ipopt::Index n, Ipopt::TNLP::LinearityType *c) |
virtual const BranchingInfo * | branchingInfo () const |
Use tminlp_ function. | |
virtual const SosInfo * | sosConstraints () const |
Use tminlp_ function. | |
virtual const PerturbInfo * | perturbInfo () const |
Use tminlp_ function. | |
virtual bool | hasUpperBoundingObjective () |
Use tminlp_ function. | |
virtual bool | eval_upper_bound_f (Index n, const Number *x, Number &obj_value) |
Use tminlp_ function. | |
virtual bool | hasLinearObjective () |
Say if problem has a linear objective (for OA). | |
SmartPtr< TMINLP > | tminlp () |
return pointer to tminlp_. | |
methods to gather information about the MINLP | |
virtual bool | get_nlp_info (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, TNLP::IndexStyleEnum &index_style) |
Return the number of variables and constraints, and the number of non-zeros in the jacobian and the hessian. | |
virtual bool | get_scaling_parameters (Number &obj_scaling, bool &use_x_scaling, Index n, Number *x_scaling, bool &use_g_scaling, Index m, Number *g_scaling) |
Return scaling parameters. | |
virtual bool | get_variables_types (Index n, VariableType *var_types) |
Get the variable type. | |
virtual bool | get_constraints_linearity (Index m, Ipopt::TNLP::LinearityType *const_types) |
Return the constraints linearity. | |
virtual bool | get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u) |
Return the information about the bound on the variables and constraints. | |
virtual bool | get_starting_point (Index n, bool init_x, Number *x, bool init_z, Number *z_L, Number *z_U, Index m, bool init_lambda, Number *lambda) |
Return the starting point. | |
virtual bool | eval_f (Index n, const Number *x, bool new_x, Number &obj_value) |
Return the value of the objective function. | |
virtual bool | eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f) |
Return the vector of the gradient of the objective w.r.t. | |
virtual bool | eval_g (Index n, const Number *x, bool new_x, Index m, Number *g) |
Return the vector of constraint values. | |
virtual bool | eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values) |
Return the jacobian of the constraints. | |
virtual bool | eval_h (Index n, const Number *x, bool new_x, Number obj_factor, Index m, const Number *lambda, bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values) |
Return the hessian of the lagrangian. | |
virtual bool | eval_gi (Index n, const Number *x, bool new_x, Index i, Number &gi) |
Compute the value of a single constraint. | |
virtual bool | eval_grad_gi (Index n, const Number *x, bool new_x, Index i, Index &nele_grad_gi, Index *jCol, Number *values) |
Compute the structure or values of the gradient for one constraint. | |
Solution Methods | |
virtual void | finalize_solution (TMINLP::SolverReturn status, Index n, const Number *x, Number obj_value) |
Use tminlp_ function. | |
Private Member Functions | |
void | gutsOfDestructor () |
Reset all data. | |
Private Attributes | |
SmartPtr< TMINLP > | tminlp_ |
Reference TMINLP which is to be relaxed. | |
int | m_ |
Number of constraints in the transformed MINLP. | |
int | n_ |
Number of variables in the transformed MINLP. | |
int | nnz_jac_ |
number of non-zeroes in the jacobian of the transformed MINLP. | |
int | offset_ |
offset for jacobian. |
More precisely
is transformed ino {array}{l} \ s.t\ - f(x) - 0\ g_l g(x) g_u\ x_l x u {array} ] The objective is put as first constraint of the problem and the extra variable is the last one.
Definition at line 39 of file BonTMINLPLinObj.hpp.
Bonmin::TMINLPLinObj::TMINLPLinObj | ( | ) |
Bonmin::TMINLPLinObj::~TMINLPLinObj | ( | ) | [virtual] |
void Bonmin::TMINLPLinObj::setTminlp | ( | SmartPtr< TMINLP > | tminlp | ) |
virtual bool Bonmin::TMINLPLinObj::get_nlp_info | ( | Index & | n, | |
Index & | m, | |||
Index & | nnz_jac_g, | |||
Index & | nnz_h_lag, | |||
TNLP::IndexStyleEnum & | index_style | |||
) | [virtual] |
Return the number of variables and constraints, and the number of non-zeros in the jacobian and the hessian.
Call tminlp_ one but number of constraints and non-zeroes in the jacobian is stored internally.
Implements Bonmin::TMINLP.
bool Bonmin::TMINLPLinObj::get_scaling_parameters | ( | Number & | obj_scaling, | |
bool & | use_x_scaling, | |||
Index | n, | |||
Number * | x_scaling, | |||
bool & | use_g_scaling, | |||
Index | m, | |||
Number * | g_scaling | |||
) | [virtual] |
Return scaling parameters.
If tminlp_ method returns true, translate constraint scaling (if asked).
Reimplemented from Bonmin::TMINLP.
Definition at line 58 of file BonTMINLPLinObj.cpp.
virtual bool Bonmin::TMINLPLinObj::get_variables_types | ( | Index | n, | |
VariableType * | var_types | |||
) | [inline, virtual] |
Get the variable type.
Just call tminlp_'s method;.
Definition at line 68 of file BonTMINLPLinObj.hpp.
References Bonmin::TMINLP::CONTINUOUS, n_, and tminlp_.
bool Bonmin::TMINLPLinObj::get_constraints_linearity | ( | Index | m, | |
Ipopt::TNLP::LinearityType * | const_types | |||
) | [virtual] |
Return the constraints linearity.
Call tminlp_'s method and translate.
Implements Bonmin::TMINLP.
Definition at line 85 of file BonTMINLPLinObj.cpp.
bool Bonmin::TMINLPLinObj::get_bounds_info | ( | Index | n, | |
Number * | x_l, | |||
Number * | x_u, | |||
Index | m, | |||
Number * | g_l, | |||
Number * | g_u | |||
) | [virtual] |
Return the information about the bound on the variables and constraints.
Call tminlp_'s method and translate constraints bounds.
Implements Bonmin::TMINLP.
Definition at line 93 of file BonTMINLPLinObj.cpp.
bool Bonmin::TMINLPLinObj::get_starting_point | ( | Index | n, | |
bool | init_x, | |||
Number * | x, | |||
bool | init_z, | |||
Number * | z_L, | |||
Number * | z_U, | |||
Index | m, | |||
bool | init_lambda, | |||
Number * | lambda | |||
) | [virtual] |
Return the starting point.
Have to translate z_L and z_U.
Implements Bonmin::TMINLP.
Definition at line 109 of file BonTMINLPLinObj.cpp.
virtual bool Bonmin::TMINLPLinObj::eval_f | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Number & | obj_value | |||
) | [inline, virtual] |
Return the value of the objective function.
Just call tminlp_ method.
Implements Bonmin::TMINLP.
Definition at line 96 of file BonTMINLPLinObj.hpp.
References n_.
virtual bool Bonmin::TMINLPLinObj::eval_grad_f | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Number * | grad_f | |||
) | [inline, virtual] |
Return the vector of the gradient of the objective w.r.t.
x. Just call tminlp_ method.
Implements Bonmin::TMINLP.
Definition at line 104 of file BonTMINLPLinObj.hpp.
bool Bonmin::TMINLPLinObj::eval_g | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Index | m, | |||
Number * | g | |||
) | [virtual] |
Return the vector of constraint values.
Use tminlp_ functions and use mapping to get the needed values.
Implements Bonmin::TMINLP.
Definition at line 126 of file BonTMINLPLinObj.cpp.
bool Bonmin::TMINLPLinObj::eval_jac_g | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Index | m, | |||
Index | nele_jac, | |||
Index * | iRow, | |||
Index * | jCol, | |||
Number * | values | |||
) | [virtual] |
Return the jacobian of the constraints.
In first call nothing to change. In later just fix the values for the simple concaves and remove entries corresponding to nonConvex constraints.
Implements Bonmin::TMINLP.
Definition at line 138 of file BonTMINLPLinObj.cpp.
bool Bonmin::TMINLPLinObj::eval_h | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Number | obj_factor, | |||
Index | m, | |||
const Number * | lambda, | |||
bool | new_lambda, | |||
Index | nele_hess, | |||
Index * | iRow, | |||
Index * | jCol, | |||
Number * | values | |||
) | [virtual] |
Return the hessian of the lagrangian.
Here we just put lambda in the correct format and call tminlp_'s function.
Implements Bonmin::TMINLP.
Definition at line 164 of file BonTMINLPLinObj.cpp.
bool Bonmin::TMINLPLinObj::eval_gi | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Index | i, | |||
Number & | gi | |||
) | [virtual] |
Compute the value of a single constraint.
The constraint number is i (starting counting from 0.
Reimplemented from Bonmin::TMINLP.
Definition at line 177 of file BonTMINLPLinObj.cpp.
bool Bonmin::TMINLPLinObj::eval_grad_gi | ( | Index | n, | |
const Number * | x, | |||
bool | new_x, | |||
Index | i, | |||
Index & | nele_grad_gi, | |||
Index * | jCol, | |||
Number * | values | |||
) | [virtual] |
Compute the structure or values of the gradient for one constraint.
The constraint * number is i (starting counting from 0. Other things are like with eval_jac_g.
Reimplemented from Bonmin::TMINLP.
Definition at line 191 of file BonTMINLPLinObj.cpp.
virtual bool Bonmin::TMINLPLinObj::get_variables_linearity | ( | Ipopt::Index | n, | |
Ipopt::TNLP::LinearityType * | c | |||
) | [inline, virtual] |
virtual void Bonmin::TMINLPLinObj::finalize_solution | ( | TMINLP::SolverReturn | status, | |
Index | n, | |||
const Number * | x, | |||
Number | obj_value | |||
) | [inline, virtual] |
Use tminlp_ function.
Implements Bonmin::TMINLP.
Definition at line 157 of file BonTMINLPLinObj.hpp.
References tminlp_.
virtual const BranchingInfo* Bonmin::TMINLPLinObj::branchingInfo | ( | ) | const [inline, virtual] |
Use tminlp_ function.
Implements Bonmin::TMINLP.
Definition at line 165 of file BonTMINLPLinObj.hpp.
References tminlp_.
virtual const SosInfo* Bonmin::TMINLPLinObj::sosConstraints | ( | ) | const [inline, virtual] |
Use tminlp_ function.
Implements Bonmin::TMINLP.
Definition at line 171 of file BonTMINLPLinObj.hpp.
References tminlp_.
virtual const PerturbInfo* Bonmin::TMINLPLinObj::perturbInfo | ( | ) | const [inline, virtual] |
Use tminlp_ function.
Reimplemented from Bonmin::TMINLP.
Definition at line 175 of file BonTMINLPLinObj.hpp.
References tminlp_.
virtual bool Bonmin::TMINLPLinObj::hasUpperBoundingObjective | ( | ) | [inline, virtual] |
Use tminlp_ function.
Reimplemented from Bonmin::TMINLP.
Definition at line 181 of file BonTMINLPLinObj.hpp.
References tminlp_.
virtual bool Bonmin::TMINLPLinObj::eval_upper_bound_f | ( | Index | n, | |
const Number * | x, | |||
Number & | obj_value | |||
) | [inline, virtual] |
Use tminlp_ function.
Reimplemented from Bonmin::TMINLP.
Definition at line 186 of file BonTMINLPLinObj.hpp.
References tminlp_.
virtual bool Bonmin::TMINLPLinObj::hasLinearObjective | ( | ) | [inline, virtual] |
Say if problem has a linear objective (for OA).
Reimplemented from Bonmin::TMINLP.
Definition at line 192 of file BonTMINLPLinObj.hpp.
SmartPtr<TMINLP> Bonmin::TMINLPLinObj::tminlp | ( | ) | [inline] |
return pointer to tminlp_.
Definition at line 194 of file BonTMINLPLinObj.hpp.
References tminlp_.
Referenced by Bonmin::Bab::branchAndBound().
void Bonmin::TMINLPLinObj::gutsOfDestructor | ( | ) | [private] |
Reset all data.
Definition at line 20 of file BonTMINLPLinObj.cpp.
References tminlp_.
Referenced by setTminlp(), and ~TMINLPLinObj().
SmartPtr<TMINLP> Bonmin::TMINLPLinObj::tminlp_ [private] |
Reference TMINLP which is to be relaxed.
Definition at line 200 of file BonTMINLPLinObj.hpp.
Referenced by branchingInfo(), eval_g(), eval_gi(), eval_grad_f(), eval_grad_gi(), eval_h(), eval_jac_g(), eval_upper_bound_f(), finalize_solution(), get_bounds_info(), get_constraints_linearity(), get_scaling_parameters(), get_starting_point(), get_variables_linearity(), get_variables_types(), gutsOfDestructor(), hasUpperBoundingObjective(), perturbInfo(), setTminlp(), sosConstraints(), and tminlp().
int Bonmin::TMINLPLinObj::m_ [private] |
Number of constraints in the transformed MINLP.
Definition at line 202 of file BonTMINLPLinObj.hpp.
Referenced by eval_g(), eval_gi(), eval_grad_gi(), eval_h(), eval_jac_g(), get_bounds_info(), get_constraints_linearity(), get_scaling_parameters(), get_starting_point(), and setTminlp().
int Bonmin::TMINLPLinObj::n_ [private] |
Number of variables in the transformed MINLP.
Definition at line 204 of file BonTMINLPLinObj.hpp.
Referenced by eval_f(), eval_g(), eval_gi(), eval_grad_f(), eval_grad_gi(), eval_h(), eval_jac_g(), get_bounds_info(), get_variables_linearity(), get_variables_types(), and setTminlp().
int Bonmin::TMINLPLinObj::nnz_jac_ [private] |
number of non-zeroes in the jacobian of the transformed MINLP.
Definition at line 206 of file BonTMINLPLinObj.hpp.
Referenced by eval_jac_g(), and setTminlp().
int Bonmin::TMINLPLinObj::offset_ [private] |
offset for jacobian.
Definition at line 208 of file BonTMINLPLinObj.hpp.
Referenced by eval_grad_gi(), eval_jac_g(), and setTminlp().