Bonmin 1.8.9
|
This is a derived class fro TMINLP2TNLP to handle adding quadratic cuts. More...
#include <BonTMINLP2Quad.hpp>
Public Member Functions | |
Constructors/Destructors | |
TMINLP2TNLPQuadCuts (const Ipopt::SmartPtr< Bonmin::TMINLP > tminlp) | |
TMINLP2TNLPQuadCuts (const TMINLP2TNLPQuadCuts &) | |
Copy Constructor. | |
virtual Bonmin::TMINLP2TNLP * | clone () const |
Virtual copy. | |
virtual | ~TMINLP2TNLPQuadCuts () |
Destructor. | |
methods to gather information about the NLP | |
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) |
This call is just passed onto parent class and add number of quadratic cuts. | |
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) |
This call is just passed onto parent class and add bounds of quadratic cuts. | |
virtual bool | get_constraints_linearity (Ipopt::Index m, Ipopt::TNLP::LinearityType *const_types) |
Returns the constraint linearity. | |
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) |
This call is just passed onto parent class and add lambda for quadratic cuts. | |
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) |
Method that returns scaling parameters (passed to parent all quadratic not scaled). | |
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 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. | |
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 (appends constraint values for quadratics). | |
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_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 | 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. | |
![]() | |
TMINLP2TNLP (const Ipopt::SmartPtr< TMINLP > tminlp) | |
TMINLP2TNLP (const TMINLP2TNLP &) | |
Copy Constructor. | |
virtual | ~TMINLP2TNLP () |
Default destructor. | |
Ipopt::Index | num_variables () const |
Get the number of variables. | |
Ipopt::Index | num_constraints () const |
Get the number of constraints. | |
Ipopt::Index | nnz_h_lag () |
Get the nomber of nz in hessian. | |
const TMINLP::VariableType * | var_types () |
Get the variable types. | |
const Ipopt::Number * | x_l () |
Get the current values for the lower bounds. | |
const Ipopt::Number * | x_u () |
Get the current values for the upper bounds. | |
const Ipopt::Number * | orig_x_l () const |
Get the original values for the lower bounds. | |
const Ipopt::Number * | orig_x_u () const |
Get the original values for the upper bounds. | |
const Ipopt::Number * | g_l () |
Get the current values for constraints lower bounds. | |
const Ipopt::Number * | g_u () |
Get the current values for constraints upper bounds. | |
const Ipopt::Number * | x_init () const |
get the starting primal point | |
const Ipopt::Number * | x_init_user () const |
get the user provided starting primal point | |
const Ipopt::Number * | duals_init () const |
get the starting dual point | |
const Ipopt::Number * | x_sol () const |
get the solution values | |
const Ipopt::Number * | g_sol () const |
get the g solution (activities) | |
const Ipopt::Number * | duals_sol () const |
get the dual values | |
Ipopt::SolverReturn | optimization_status () const |
Get Optimization status. | |
Ipopt::Number | obj_value () const |
Get the objective value. | |
void | set_obj_value (Ipopt::Number value) |
Manually set objective value. | |
void | force_fractionnal_sol () |
force solution to be fractionnal. | |
void | SetVariablesBounds (Ipopt::Index n, const Ipopt::Number *x_l, const Ipopt::Number *x_u) |
Change the bounds on the variables. | |
void | SetVariablesLowerBounds (Ipopt::Index n, const Ipopt::Number *x_l) |
Change the lower bound on the variables. | |
void | SetVariablesUpperBounds (Ipopt::Index n, const Ipopt::Number *x_u) |
Change the upper bound on the variable. | |
void | SetVariableBounds (Ipopt::Index var_no, Ipopt::Number x_l, Ipopt::Number x_u) |
Change the bounds on the variable. | |
void | SetVariableLowerBound (Ipopt::Index var_no, Ipopt::Number x_l) |
Change the lower bound on the variable. | |
void | SetVariableUpperBound (Ipopt::Index var_no, Ipopt::Number x_u) |
Change the upper bound on the variable. | |
void | resetStartingPoint () |
reset the starting point to original one. | |
void | setxInit (Ipopt::Index n, const Ipopt::Number *x_init) |
set the starting point to x_init | |
void | setDualsInit (Ipopt::Index n, const Ipopt::Number *duals_init) |
set the dual starting point to duals_init | |
int | has_x_init () |
xInit has been set? | |
void | Set_x_sol (Ipopt::Index n, const Ipopt::Number *x_sol) |
Set the contiuous solution. | |
void | Set_dual_sol (Ipopt::Index n, const Ipopt::Number *dual_sol) |
Set the contiuous dual solution. | |
void | SetVariableType (Ipopt::Index n, TMINLP::VariableType type) |
Change the type of the variable. | |
void | outputDiffs (const std::string &probName, const std::string *varNames) |
Procedure to ouptut relevant informations to reproduce a sub-problem. | |
virtual bool | get_variables_linearity (Ipopt::Index n, LinearityType *var_types) |
Returns the variables linearity. | |
virtual bool | hasLinearObjective () |
returns true if objective is linear. | |
virtual bool | get_warm_start_iterate (Ipopt::IteratesVector &warm_start_iterate) |
Methat that returns an Ipopt IteratesVector that has the starting point for all internal varibles. | |
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) |
This method is called when the algorithm is complete so the TNLP can store/write the solution. | |
virtual bool | intermediate_callback (Ipopt::AlgorithmMode mode, Ipopt::Index iter, Ipopt::Number obj_value, Ipopt::Number inf_pr, Ipopt::Number inf_du, Ipopt::Number mu, Ipopt::Number d_norm, Ipopt::Number regularization_size, Ipopt::Number alpha_du, Ipopt::Number alpha_pr, Ipopt::Index ls_trials, const Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq) |
Intermediate Callback method for the user. | |
void | SetWarmStarter (Ipopt::SmartPtr< IpoptInteriorWarmStarter > warm_starter) |
Ipopt::SmartPtr< IpoptInteriorWarmStarter > | GetWarmStarter () |
virtual bool | hasUpperBoundingObjective () |
Say if has a specific function to compute upper bounds. | |
double | evaluateUpperBoundingFunction (const double *x) |
Evaluate the upper bounding function at given point and store the result. | |
virtual const int * | get_const_xtra_id () const |
Access array describing constraint to which perspectives should be applied. | |
double | check_solution (OsiObject **objects=0, int nObjects=-1) |
Round and check the current solution, return norm inf of constraint violation. | |
![]() | |
DECLARE_STD_EXCEPTION (INVALID_TNLP) | |
TNLP () | |
virtual | ~TNLP () |
virtual bool | get_var_con_metadata (Index n, StringMetaDataMapType &var_string_md, IntegerMetaDataMapType &var_integer_md, NumericMetaDataMapType &var_numeric_md, Index m, StringMetaDataMapType &con_string_md, IntegerMetaDataMapType &con_integer_md, NumericMetaDataMapType &con_numeric_md) |
virtual Index | get_number_of_nonlinear_variables () |
virtual bool | get_list_of_nonlinear_variables (Index num_nonlin_vars, Index *pos_nonlin_vars) |
virtual void | finalize_metadata (Index n, const StringMetaDataMapType &var_string_md, const IntegerMetaDataMapType &var_integer_md, const NumericMetaDataMapType &var_numeric_md, Index m, const StringMetaDataMapType &con_string_md, const IntegerMetaDataMapType &con_integer_md, const NumericMetaDataMapType &con_numeric_md) |
virtual bool | intermediate_callback (AlgorithmMode mode, Index iter, Number obj_value, Number inf_pr, Number inf_du, Number mu, Number d_norm, Number regularization_size, Number alpha_du, Number alpha_pr, Index ls_trials, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq) |
bool | get_curr_iterate (const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq, bool scaled, Index n, Number *x, Number *z_L, Number *z_U, Index m, Number *g, Number *lambda) const |
bool | get_curr_violations (const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq, bool scaled, Index n, Number *x_L_violation, Number *x_U_violation, Number *compl_x_L, Number *compl_x_U, Number *grad_lag_x, Index m, Number *nlp_constraint_violation, Number *compl_g) const |
TNLP () | |
virtual | ~TNLP () |
virtual bool | get_var_con_metadata (Index n, StringMetaDataMapType &var_string_md, IntegerMetaDataMapType &var_integer_md, NumericMetaDataMapType &var_numeric_md, Index m, StringMetaDataMapType &con_string_md, IntegerMetaDataMapType &con_integer_md, NumericMetaDataMapType &con_numeric_md) |
virtual Index | get_number_of_nonlinear_variables () |
virtual bool | get_list_of_nonlinear_variables (Index num_nonlin_vars, Index *pos_nonlin_vars) |
virtual void | finalize_metadata (Index n, const StringMetaDataMapType &var_string_md, const IntegerMetaDataMapType &var_integer_md, const NumericMetaDataMapType &var_numeric_md, Index m, const StringMetaDataMapType &con_string_md, const IntegerMetaDataMapType &con_integer_md, const NumericMetaDataMapType &con_numeric_md) |
virtual bool | intermediate_callback (AlgorithmMode mode, Index iter, Number obj_value, Number inf_pr, Number inf_du, Number mu, Number d_norm, Number regularization_size, Number alpha_du, Number alpha_pr, Index ls_trials, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq) |
bool | get_curr_iterate (const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq, bool scaled, Index n, Number *x, Number *z_L, Number *z_U, Index m, Number *g, Number *lambda) const |
bool | get_curr_violations (const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq, bool scaled, Index n, Number *x_L_violation, Number *x_U_violation, Number *compl_x_L, Number *compl_x_U, Number *grad_lag_x, Index m, Number *nlp_constraint_violation, Number *compl_g) const |
![]() | |
ReferencedObject () | |
virtual | ~ReferencedObject () |
Index | ReferenceCount () const |
void | AddRef (const Referencer *referencer) const |
void | ReleaseRef (const Referencer *referencer) const |
Default Compiler Generated Methods | |
(Hidden to avoid implicit creation/calling). These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called. | |
TMINLP2TNLPQuadCuts () | |
Default Constructor. | |
TMINLP2TNLPQuadCuts & | operator= (const TMINLP2TNLP &) |
Overloaded Equals Operator. | |
Cuts management. | |
void | addCuts (const Cuts &cuts, bool safe) |
Add some linear or quadratic cuts to the problem formulation if some of the OsiRowCuts are quadratic they will be well understood as long as safe is true. | |
void | addCuts (const OsiCuts &cuts) |
Add some cuts to the problem formulaiton (handles Quadratics). | |
virtual void | addCuts (unsigned int numberCuts, const OsiRowCut **cuts) |
Add some linear cuts to the problem formulation. | |
void | removeCuts (unsigned int number, const int *toRemove) |
Remove some cuts from the formulation. | |
void | set_linear_objective (int n_var, const double *obj, double c_0) |
Change objective to a linear one whith given objective function. | |
void | reset_objective () |
Reset objective to original one. | |
void | addRowCuts (const OsiCuts &cuts, bool safe) |
Add some cuts to the problem formulaiton (handles Quadratics). | |
Additional Inherited Members | |
![]() | |
enum | LinearityType |
enum | IndexStyleEnum |
typedef std::map< std::string, std::vector< std::string > > | StringMetaDataMapType |
typedef std::map< std::string, std::vector< Index > > | IntegerMetaDataMapType |
typedef std::map< std::string, std::vector< Number > > | NumericMetaDataMapType |
![]() | |
LINEAR | |
NON_LINEAR | |
C_STYLE | |
FORTRAN_STYLE | |
![]() | |
Ipopt::Index | nnz_h_lag () const |
Access number of entries in tminlp_ hessian. | |
Ipopt::Index | nnz_jac_g () const |
Access number of entries in tminlp_ hessian. | |
TNLP::IndexStyleEnum | index_style () const |
Acces index_style. | |
![]() | |
vector< TMINLP::VariableType > | var_types_ |
Types of the variable (TMINLP::CONTINUOUS, TMINLP::INTEGER, TMINLP::BINARY). | |
vector< Ipopt::Number > | x_l_ |
Current lower bounds on variables. | |
vector< Ipopt::Number > | x_u_ |
Current upper bounds on variables. | |
vector< Ipopt::Number > | orig_x_l_ |
Original lower bounds on variables. | |
vector< Ipopt::Number > | orig_x_u_ |
Original upper bounds on variables. | |
vector< Ipopt::Number > | g_l_ |
Lower bounds on constraints values. | |
vector< Ipopt::Number > | g_u_ |
Upper bounds on constraints values. | |
vector< Ipopt::Number > | x_init_ |
Initial primal point. | |
Ipopt::Number * | duals_init_ |
Initial values for all dual multipliers (constraints then lower bounds then upper bounds) | |
vector< Ipopt::Number > | x_init_user_ |
User-provideed initial prmal point. | |
vector< Ipopt::Number > | x_sol_ |
Optimal solution. | |
vector< Ipopt::Number > | g_sol_ |
Activities of constraint g( x_sol_) | |
vector< Ipopt::Number > | duals_sol_ |
Dual multipliers of constraints and bounds. | |
This is a derived class fro TMINLP2TNLP to handle adding quadratic cuts.
Definition at line 22 of file BonTMINLP2Quad.hpp.
Bonmin::TMINLP2TNLPQuadCuts::TMINLP2TNLPQuadCuts | ( | const Ipopt::SmartPtr< Bonmin::TMINLP > | tminlp | ) |
Bonmin::TMINLP2TNLPQuadCuts::TMINLP2TNLPQuadCuts | ( | const TMINLP2TNLPQuadCuts & | ) |
Copy Constructor.
|
virtual |
Destructor.
|
protected |
Default Constructor.
|
inlinevirtual |
Virtual copy.
Reimplemented from Bonmin::TMINLP2TNLP.
Definition at line 41 of file BonTMINLP2Quad.hpp.
|
virtual |
This call is just passed onto parent class and add number of quadratic cuts.
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
This call is just passed onto parent class and add bounds of quadratic cuts.
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
Returns the constraint linearity.
array should be alocated with length at least m..
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
This call is just passed onto parent class and add lambda for quadratic cuts.
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
Method that returns scaling parameters (passed to parent all quadratic not scaled).
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
Returns the value of the objective function in x.
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
Returns the vector of the gradient of the objective w.r.t.
x
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
Returns the vector of constraint values in x (appends constraint values for quadratics).
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
Returns the jacobian of the constraints.
The vectors iRow and jCol only need to be set once. The first call is used to set the structure only (iRow and jCol will be non-NULL, and values will be NULL) For subsequent calls, iRow and jCol will be NULL.
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
compute the value of a single constraint
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
compute the structure or values of the gradient for one constraint
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
Return the hessian of the lagrangian.
The vectors iRow and jCol only need to be set once (during the first call). The first call is used to set the structure only (iRow and jCol will be non-NULL, and values will be NULL) For subsequent calls, iRow and jCol will be NULL. This matrix is symmetric - specify the lower diagonal only
Reimplemented from Bonmin::TMINLP2TNLP.
void Bonmin::TMINLP2TNLPQuadCuts::addCuts | ( | const Cuts & | cuts, |
bool | safe ) |
Add some linear or quadratic cuts to the problem formulation if some of the OsiRowCuts are quadratic they will be well understood as long as safe is true.
|
virtual |
Add some cuts to the problem formulaiton (handles Quadratics).
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
Add some linear cuts to the problem formulation.
Reimplemented from Bonmin::TMINLP2TNLP.
|
virtual |
Remove some cuts from the formulation.
Reimplemented from Bonmin::TMINLP2TNLP.
void Bonmin::TMINLP2TNLPQuadCuts::set_linear_objective | ( | int | n_var, |
const double * | obj, | ||
double | c_0 ) |
Change objective to a linear one whith given objective function.
|
inline |
Reset objective to original one.
Definition at line 148 of file BonTMINLP2Quad.hpp.
|
protected |
Add some cuts to the problem formulaiton (handles Quadratics).
|
protected |
Overloaded Equals Operator.