Bonmin 1.8.9
|
From a TMINLP, this class adapts to another TMINLP where the original objective is transformed into a constraint by adding an extra variable which is minimized. More...
#include <BonTMINLPLinObj.hpp>
Public Member Functions | |
TMINLPLinObj () | |
Default constructor. | |
virtual | ~TMINLPLinObj () |
destructor. | |
void | setTminlp (Ipopt::SmartPtr< TMINLP > tminlp) |
set reference TMINLP | |
methods to gather information about the MINLP | |
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) |
Return the number of variables and constraints, and the number of non-zeros in the jacobian and the hessian. | |
virtual bool | get_scaling_parameters (Ipopt::Number &obj_scaling, bool &use_x_scaling, Ipopt::Index n, Ipopt::Number *x_scaling, bool &use_g_scaling, Ipopt::Index m, Ipopt::Number *g_scaling) |
Return scaling parameters. | |
virtual bool | get_variables_types (Ipopt::Index n, VariableType *var_types) |
Get the variable type. | |
virtual bool | get_constraints_linearity (Ipopt::Index m, Ipopt::TNLP::LinearityType *const_types) |
Return the constraints linearity. | |
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) |
Return the information about the bound on the variables and constraints. | |
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) |
Return the starting point. | |
virtual bool | eval_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value) |
Return the value of the objective function. | |
virtual bool | eval_grad_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f) |
Return the vector of the gradient of the objective w.r.t. | |
virtual bool | eval_g (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g) |
Return the vector of constraint values. | |
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) |
Return the jacobian of the constraints. | |
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_gi (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index i, Ipopt::Number &gi) |
Compute the value of a single constraint. | |
virtual bool | eval_grad_gi (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index i, Ipopt::Index &nele_grad_gi, Ipopt::Index *jCol, Ipopt::Number *values) |
Compute the structure or values of the gradient for one constraint. | |
virtual bool | get_variables_linearity (Ipopt::Index n, Ipopt::TNLP::LinearityType *c) |
overload this method to provide the variables linearity. | |
![]() | |
TMINLP () | |
virtual | ~TMINLP () |
Default destructor. | |
virtual bool | get_constraint_convexities (int m, TMINLP::Convexity *constraints_convexities) const |
Get accest to constraint convexities. | |
virtual bool | get_number_nonconvex (int &number_non_conv, int &number_concave) const |
Get dimension information on nonconvex constraints. | |
virtual bool | get_constraint_convexities (int number_non_conv, MarkedNonConvex *non_convs) const |
Get array describing the constraints marked nonconvex in the model. | |
virtual bool | get_simple_concave_constraints (int number_concave, SimpleConcaveConstraint *simple_concave) const |
Fill array containing indices of simple concave constraints. | |
bool | hasGeneralInteger () |
Say if problem has general integer variables. | |
virtual const int * | get_const_xtra_id () const |
Access array describing constraint to which perspectives should be applied. | |
![]() | |
ReferencedObject () | |
virtual | ~ReferencedObject () |
Index | ReferenceCount () const |
void | AddRef (const Referencer *referencer) const |
void | ReleaseRef (const Referencer *referencer) const |
Solution Methods | |
virtual void | finalize_solution (TMINLP::SolverReturn status, Ipopt::Index n, const Ipopt::Number *x, Ipopt::Number obj_value) |
Use tminlp_ function. | |
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 (Ipopt::Index n, const Ipopt::Number *x, Ipopt::Number &obj_value) |
Use tminlp_ function. | |
virtual bool | hasLinearObjective () |
Say if problem has a linear objective (for OA) | |
Ipopt::SmartPtr< TMINLP > | tminlp () |
return pointer to tminlp_. | |
Additional Inherited Members | |
![]() | |
enum | SolverReturn { SUCCESS , INFEASIBLE , CONTINUOUS_UNBOUNDED , LIMIT_EXCEEDED , USER_INTERRUPT , MINLP_ERROR } |
Return statuses of algorithm. More... | |
enum | VariableType { CONTINUOUS , BINARY , INTEGER } |
Type of the variables. More... | |
enum | Convexity { Convex , NonConvex , SimpleConcave } |
Used to mark constraints of the problem. More... | |
![]() | |
TMINLP (const TMINLP &) | |
Copy constructor. | |
void | operator= (const TMINLP &) |
Overloaded Equals Operator. | |
From a TMINLP, this class adapts to another TMINLP where the original objective is transformed into a constraint by adding an extra variable which is minimized.
More precisely
is transformed ino \begin{array}{l} \min \eta\ s.t\ -\infty \leq f(x) - \eta \leq 0\ g_l \leq g(x) \leq g_u\ x_l \leq x \leq u \end{array} \f] 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 | ( | ) |
Default constructor.
|
virtual |
destructor.
void Bonmin::TMINLPLinObj::setTminlp | ( | Ipopt::SmartPtr< TMINLP > | tminlp | ) |
set reference TMINLP
|
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.
|
virtual |
Return scaling parameters.
If tminlp_ method returns true, translate constraint scaling (if asked).
Reimplemented from Bonmin::TMINLP.
|
inlinevirtual |
Get the variable type.
Just call tminlp_'s method;.
Implements Bonmin::TMINLP.
Definition at line 68 of file BonTMINLPLinObj.hpp.
|
virtual |
|
virtual |
Return the information about the bound on the variables and constraints.
Call tminlp_'s method and translate constraints bounds.
Implements Bonmin::TMINLP.
|
virtual |
|
inlinevirtual |
Return the value of the objective function.
Just call tminlp_ method.
Implements Bonmin::TMINLP.
Definition at line 96 of file BonTMINLPLinObj.hpp.
|
inlinevirtual |
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.
|
virtual |
Return the vector of constraint values.
Use tminlp_ functions and use mapping to get the needed values.
Implements Bonmin::TMINLP.
|
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.
|
virtual |
Return the hessian of the lagrangian.
Here we just put lambda in the correct format and call tminlp_'s function.
Implements Bonmin::TMINLP.
|
virtual |
Compute the value of a single constraint.
The constraint number is i (starting counting from 0.
Reimplemented from Bonmin::TMINLP.
|
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.
|
inlinevirtual |
overload this method to provide the variables linearity.
array should be allocated with length at least n.
Implements Bonmin::TMINLP.
Definition at line 145 of file BonTMINLPLinObj.hpp.
|
inlinevirtual |
Use tminlp_ function.
Implements Bonmin::TMINLP.
Definition at line 157 of file BonTMINLPLinObj.hpp.
|
inlinevirtual |
Use tminlp_ function.
Implements Bonmin::TMINLP.
Definition at line 165 of file BonTMINLPLinObj.hpp.
|
inlinevirtual |
Use tminlp_ function.
Implements Bonmin::TMINLP.
Definition at line 171 of file BonTMINLPLinObj.hpp.
|
inlinevirtual |
Use tminlp_ function.
Reimplemented from Bonmin::TMINLP.
Definition at line 175 of file BonTMINLPLinObj.hpp.
|
inlinevirtual |
Use tminlp_ function.
Reimplemented from Bonmin::TMINLP.
Definition at line 181 of file BonTMINLPLinObj.hpp.
|
inlinevirtual |
Use tminlp_ function.
Reimplemented from Bonmin::TMINLP.
Definition at line 186 of file BonTMINLPLinObj.hpp.
|
inlinevirtual |
Say if problem has a linear objective (for OA)
Reimplemented from Bonmin::TMINLP.
Definition at line 192 of file BonTMINLPLinObj.hpp.
|
inline |
return pointer to tminlp_.
Definition at line 194 of file BonTMINLPLinObj.hpp.