Bonmin 1.8.9
Loading...
Searching...
No Matches
Bonmin::TMINLP2TNLP Class Reference

This is an adapter class that converts a TMINLP to a TNLP to be solved by Ipopt. More...

#include <BonTMINLP2TNLP.hpp>

+ Inheritance diagram for Bonmin::TMINLP2TNLP:
+ Collaboration diagram for Bonmin::TMINLP2TNLP:

Public Member Functions

Constructors/Destructors
 TMINLP2TNLP (const Ipopt::SmartPtr< TMINLP > tminlp)
 
 TMINLP2TNLP (const TMINLP2TNLP &)
 Copy Constructor.
 
virtual TMINLP2TNLPclone () const
 virtual copy .
 
virtual ~TMINLP2TNLP ()
 Default destructor.
 
Methods to modify the MINLP and form the NLP
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::VariableTypevar_types ()
 Get the variable types.
 
const Ipopt::Numberx_l ()
 Get the current values for the lower bounds.
 
const Ipopt::Numberx_u ()
 Get the current values for the upper bounds.
 
const Ipopt::Numberorig_x_l () const
 Get the original values for the lower bounds.
 
const Ipopt::Numberorig_x_u () const
 Get the original values for the upper bounds.
 
const Ipopt::Numberg_l ()
 Get the current values for constraints lower bounds.
 
const Ipopt::Numberg_u ()
 Get the current values for constraints upper bounds.
 
const Ipopt::Numberx_init () const
 get the starting primal point
 
const Ipopt::Numberx_init_user () const
 get the user provided starting primal point
 
const Ipopt::Numberduals_init () const
 get the starting dual point
 
const Ipopt::Numberx_sol () const
 get the solution values
 
const Ipopt::Numberg_sol () const
 get the g solution (activities)
 
const Ipopt::Numberduals_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.
 
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, TNLP::IndexStyleEnum &index_style)
 This call is just passed onto the TMINLP object.
 
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)
 The caller is allowed to modify the bounds, so this method returns the internal bounds information.
 
virtual bool get_constraints_linearity (Ipopt::Index m, LinearityType *const_types)
 Returns the constraint linearity.
 
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_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.
 
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.
 
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 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.
 
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.
 
Solution Methods
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.
 
Methods for setting and getting the warm starter

Method called to check wether a problem has still some variable not fixed.

If there are no more unfixed vars, checks wether the solution given by the bounds is feasible.

void SetWarmStarter (Ipopt::SmartPtr< IpoptInteriorWarmStarter > warm_starter)
 
Ipopt::SmartPtr< IpoptInteriorWarmStarterGetWarmStarter ()
 
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.
 
Cuts management.
virtual void addCuts (unsigned int numberCuts, const OsiRowCut **cuts)
 Methods are not implemented at this point.
 
virtual void addCuts (const OsiCuts &cuts)
 Add some cuts to the problem formulaiton (handles Quadratics).
 
virtual void removeCuts (unsigned int number, const int *toRemove)
 Remove some cuts to the formulation.
 
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.
 
- Public Member Functions inherited from Ipopt::TNLP
 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
 
- Public Member Functions inherited from Ipopt::ReferencedObject
 ReferencedObject ()
 
virtual ~ReferencedObject ()
 
Index ReferenceCount () const
 
void AddRef (const Referencer *referencer) const
 
void ReleaseRef (const Referencer *referencer) const
 

Protected Member Functions

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.
 

Protected Attributes

These should be modified in derived class to always maintain there correctness.

They are directly queried by OsiTMINLPInterface without virtual function for speed.

vector< TMINLP::VariableTypevar_types_
 Types of the variable (TMINLP::CONTINUOUS, TMINLP::INTEGER, TMINLP::BINARY).
 
vector< Ipopt::Numberx_l_
 Current lower bounds on variables.
 
vector< Ipopt::Numberx_u_
 Current upper bounds on variables.
 
vector< Ipopt::Numberorig_x_l_
 Original lower bounds on variables.
 
vector< Ipopt::Numberorig_x_u_
 Original upper bounds on variables.
 
vector< Ipopt::Numberg_l_
 Lower bounds on constraints values.
 
vector< Ipopt::Numberg_u_
 Upper bounds on constraints values.
 
vector< Ipopt::Numberx_init_
 Initial primal point.
 
Ipopt::Numberduals_init_
 Initial values for all dual multipliers (constraints then lower bounds then upper bounds)
 
vector< Ipopt::Numberx_init_user_
 User-provideed initial prmal point.
 
vector< Ipopt::Numberx_sol_
 Optimal solution.
 
vector< Ipopt::Numberg_sol_
 Activities of constraint g( x_sol_)
 
vector< Ipopt::Numberduals_sol_
 Dual multipliers of constraints and bounds.
 

Additional Inherited Members

- Public Types inherited from Ipopt::TNLP
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
 
- Public Attributes inherited from Ipopt::TNLP
 LINEAR
 
 NON_LINEAR
 
 C_STYLE
 
 FORTRAN_STYLE
 

Detailed Description

This is an adapter class that converts a TMINLP to a TNLP to be solved by Ipopt.

It allows an external caller to modify the bounds of variables, allowing the treatment of binary and integer variables as relaxed, or fixed

Definition at line 32 of file BonTMINLP2TNLP.hpp.

Constructor & Destructor Documentation

◆ TMINLP2TNLP() [1/2]

Bonmin::TMINLP2TNLP::TMINLP2TNLP ( const Ipopt::SmartPtr< TMINLP > tminlp)

◆ TMINLP2TNLP() [2/2]

Bonmin::TMINLP2TNLP::TMINLP2TNLP ( const TMINLP2TNLP & )

Copy Constructor.

Warning
source and copy point to the same tminlp_.

◆ ~TMINLP2TNLP()

virtual Bonmin::TMINLP2TNLP::~TMINLP2TNLP ( )
virtual

Default destructor.

Member Function Documentation

◆ clone()

virtual TMINLP2TNLP * Bonmin::TMINLP2TNLP::clone ( ) const
inlinevirtual

virtual copy .

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

Definition at line 50 of file BonTMINLP2TNLP.hpp.

◆ num_variables()

Ipopt::Index Bonmin::TMINLP2TNLP::num_variables ( ) const
inline

Get the number of variables.

Definition at line 61 of file BonTMINLP2TNLP.hpp.

◆ num_constraints()

Ipopt::Index Bonmin::TMINLP2TNLP::num_constraints ( ) const
inline

Get the number of constraints.

Definition at line 68 of file BonTMINLP2TNLP.hpp.

◆ nnz_h_lag() [1/2]

Ipopt::Index Bonmin::TMINLP2TNLP::nnz_h_lag ( )
inline

Get the nomber of nz in hessian.

Definition at line 74 of file BonTMINLP2TNLP.hpp.

◆ var_types()

const TMINLP::VariableType * Bonmin::TMINLP2TNLP::var_types ( )
inline

Get the variable types.

Definition at line 79 of file BonTMINLP2TNLP.hpp.

◆ x_l()

const Ipopt::Number * Bonmin::TMINLP2TNLP::x_l ( )
inline

Get the current values for the lower bounds.

Definition at line 85 of file BonTMINLP2TNLP.hpp.

◆ x_u()

const Ipopt::Number * Bonmin::TMINLP2TNLP::x_u ( )
inline

Get the current values for the upper bounds.

Definition at line 90 of file BonTMINLP2TNLP.hpp.

◆ orig_x_l()

const Ipopt::Number * Bonmin::TMINLP2TNLP::orig_x_l ( ) const
inline

Get the original values for the lower bounds.

Definition at line 96 of file BonTMINLP2TNLP.hpp.

◆ orig_x_u()

const Ipopt::Number * Bonmin::TMINLP2TNLP::orig_x_u ( ) const
inline

Get the original values for the upper bounds.

Definition at line 101 of file BonTMINLP2TNLP.hpp.

◆ g_l()

const Ipopt::Number * Bonmin::TMINLP2TNLP::g_l ( )
inline

Get the current values for constraints lower bounds.

Definition at line 107 of file BonTMINLP2TNLP.hpp.

◆ g_u()

const Ipopt::Number * Bonmin::TMINLP2TNLP::g_u ( )
inline

Get the current values for constraints upper bounds.

Definition at line 112 of file BonTMINLP2TNLP.hpp.

◆ x_init()

const Ipopt::Number * Bonmin::TMINLP2TNLP::x_init ( ) const
inline

get the starting primal point

Definition at line 118 of file BonTMINLP2TNLP.hpp.

◆ x_init_user()

const Ipopt::Number * Bonmin::TMINLP2TNLP::x_init_user ( ) const
inline

get the user provided starting primal point

Definition at line 124 of file BonTMINLP2TNLP.hpp.

◆ duals_init()

const Ipopt::Number * Bonmin::TMINLP2TNLP::duals_init ( ) const
inline

get the starting dual point

Definition at line 130 of file BonTMINLP2TNLP.hpp.

◆ x_sol()

const Ipopt::Number * Bonmin::TMINLP2TNLP::x_sol ( ) const
inline

get the solution values

Definition at line 136 of file BonTMINLP2TNLP.hpp.

◆ g_sol()

const Ipopt::Number * Bonmin::TMINLP2TNLP::g_sol ( ) const
inline

get the g solution (activities)

Definition at line 142 of file BonTMINLP2TNLP.hpp.

◆ duals_sol()

const Ipopt::Number * Bonmin::TMINLP2TNLP::duals_sol ( ) const
inline

get the dual values

Definition at line 148 of file BonTMINLP2TNLP.hpp.

◆ optimization_status()

Ipopt::SolverReturn Bonmin::TMINLP2TNLP::optimization_status ( ) const
inline

Get Optimization status.

Definition at line 154 of file BonTMINLP2TNLP.hpp.

◆ obj_value()

Ipopt::Number Bonmin::TMINLP2TNLP::obj_value ( ) const
inline

Get the objective value.

Definition at line 160 of file BonTMINLP2TNLP.hpp.

◆ set_obj_value()

void Bonmin::TMINLP2TNLP::set_obj_value ( Ipopt::Number value)
inline

Manually set objective value.

Definition at line 166 of file BonTMINLP2TNLP.hpp.

◆ force_fractionnal_sol()

void Bonmin::TMINLP2TNLP::force_fractionnal_sol ( )

force solution to be fractionnal.

◆ SetVariablesBounds()

void Bonmin::TMINLP2TNLP::SetVariablesBounds ( Ipopt::Index n,
const Ipopt::Number * x_l,
const Ipopt::Number * x_u )

Change the bounds on the variables.

◆ SetVariablesLowerBounds()

void Bonmin::TMINLP2TNLP::SetVariablesLowerBounds ( Ipopt::Index n,
const Ipopt::Number * x_l )

Change the lower bound on the variables.

◆ SetVariablesUpperBounds()

void Bonmin::TMINLP2TNLP::SetVariablesUpperBounds ( Ipopt::Index n,
const Ipopt::Number * x_u )

Change the upper bound on the variable.

◆ SetVariableBounds()

void Bonmin::TMINLP2TNLP::SetVariableBounds ( Ipopt::Index var_no,
Ipopt::Number x_l,
Ipopt::Number x_u )

Change the bounds on the variable.

◆ SetVariableLowerBound()

void Bonmin::TMINLP2TNLP::SetVariableLowerBound ( Ipopt::Index var_no,
Ipopt::Number x_l )

Change the lower bound on the variable.

◆ SetVariableUpperBound()

void Bonmin::TMINLP2TNLP::SetVariableUpperBound ( Ipopt::Index var_no,
Ipopt::Number x_u )

Change the upper bound on the variable.

◆ resetStartingPoint()

void Bonmin::TMINLP2TNLP::resetStartingPoint ( )

reset the starting point to original one.

◆ setxInit()

void Bonmin::TMINLP2TNLP::setxInit ( Ipopt::Index n,
const Ipopt::Number * x_init )

set the starting point to x_init

◆ setDualsInit()

void Bonmin::TMINLP2TNLP::setDualsInit ( Ipopt::Index n,
const Ipopt::Number * duals_init )

set the dual starting point to duals_init

◆ has_x_init()

int Bonmin::TMINLP2TNLP::has_x_init ( )
inline

xInit has been set?

Returns
0 if not, 1 if only primal 2 if primal dual.

Definition at line 207 of file BonTMINLP2TNLP.hpp.

◆ Set_x_sol()

void Bonmin::TMINLP2TNLP::Set_x_sol ( Ipopt::Index n,
const Ipopt::Number * x_sol )

Set the contiuous solution.

◆ Set_dual_sol()

void Bonmin::TMINLP2TNLP::Set_dual_sol ( Ipopt::Index n,
const Ipopt::Number * dual_sol )

Set the contiuous dual solution.

◆ SetVariableType()

void Bonmin::TMINLP2TNLP::SetVariableType ( Ipopt::Index n,
TMINLP::VariableType type )

Change the type of the variable.

◆ outputDiffs()

void Bonmin::TMINLP2TNLP::outputDiffs ( const std::string & probName,
const std::string * varNames )

Procedure to ouptut relevant informations to reproduce a sub-problem.

Compare the current problem to the problem to solve and writes files with bounds which have changed and current starting point.

◆ get_nlp_info()

virtual bool Bonmin::TMINLP2TNLP::get_nlp_info ( Ipopt::Index & n,
Ipopt::Index & m,
Ipopt::Index & nnz_jac_g,
Ipopt::Index & nnz_h_lag,
TNLP::IndexStyleEnum & index_style )
virtual

This call is just passed onto the TMINLP object.

Implements Ipopt::TNLP.

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

◆ get_bounds_info()

virtual bool Bonmin::TMINLP2TNLP::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 )
virtual

The caller is allowed to modify the bounds, so this method returns the internal bounds information.

Implements Ipopt::TNLP.

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

◆ get_constraints_linearity()

virtual bool Bonmin::TMINLP2TNLP::get_constraints_linearity ( Ipopt::Index m,
LinearityType * const_types )
inlinevirtual

Returns the constraint linearity.

array should be alocated with length at least m..

Reimplemented from Ipopt::TNLP.

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

Definition at line 242 of file BonTMINLP2TNLP.hpp.

◆ get_variables_linearity()

virtual bool Bonmin::TMINLP2TNLP::get_variables_linearity ( Ipopt::Index n,
LinearityType * var_types )
inlinevirtual

Returns the variables linearity.

array should be alocated with length at least n..

Reimplemented from Ipopt::TNLP.

Definition at line 249 of file BonTMINLP2TNLP.hpp.

◆ hasLinearObjective()

virtual bool Bonmin::TMINLP2TNLP::hasLinearObjective ( )
inlinevirtual

returns true if objective is linear.

Definition at line 255 of file BonTMINLP2TNLP.hpp.

◆ get_starting_point()

virtual bool Bonmin::TMINLP2TNLP::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 )
virtual

Method called by Ipopt to get the starting point.

The bools init_x and init_lambda are both inputs and outputs. As inputs, they indicate whether or not the algorithm wants you to initialize x and lambda respectively. If, for some reason, the algorithm wants you to initialize these and you cannot, set the respective bool to false.

Implements Ipopt::TNLP.

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

◆ get_scaling_parameters()

virtual bool Bonmin::TMINLP2TNLP::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 )
virtual

Method that returns scaling parameters.

Reimplemented from Ipopt::TNLP.

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

◆ get_warm_start_iterate()

virtual bool Bonmin::TMINLP2TNLP::get_warm_start_iterate ( Ipopt::IteratesVector & warm_start_iterate)
virtual

Methat that returns an Ipopt IteratesVector that has the starting point for all internal varibles.

Reimplemented from Ipopt::TNLP.

◆ eval_f()

virtual bool Bonmin::TMINLP2TNLP::eval_f ( Ipopt::Index n,
const Ipopt::Number * x,
bool new_x,
Ipopt::Number & obj_value )
virtual

Returns the value of the objective function in x.

Implements Ipopt::TNLP.

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

◆ eval_grad_f()

virtual bool Bonmin::TMINLP2TNLP::eval_grad_f ( Ipopt::Index n,
const Ipopt::Number * x,
bool new_x,
Ipopt::Number * grad_f )
virtual

Returns the vector of the gradient of the objective w.r.t.

x

Implements Ipopt::TNLP.

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

◆ eval_g()

virtual bool Bonmin::TMINLP2TNLP::eval_g ( Ipopt::Index n,
const Ipopt::Number * x,
bool new_x,
Ipopt::Index m,
Ipopt::Number * g )
virtual

Returns the vector of constraint values in x.

Implements Ipopt::TNLP.

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

◆ eval_jac_g()

virtual bool Bonmin::TMINLP2TNLP::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 )
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.

Implements Ipopt::TNLP.

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

◆ eval_gi()

virtual bool Bonmin::TMINLP2TNLP::eval_gi ( Ipopt::Index n,
const Ipopt::Number * x,
bool new_x,
Ipopt::Index i,
Ipopt::Number & gi )
virtual

compute the value of a single constraint

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

◆ eval_grad_gi()

virtual bool Bonmin::TMINLP2TNLP::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 )
virtual

compute the structure or values of the gradient for one constraint

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

◆ eval_h()

virtual bool Bonmin::TMINLP2TNLP::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 )
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 Ipopt::TNLP.

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

◆ finalize_solution()

virtual void Bonmin::TMINLP2TNLP::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

This method is called when the algorithm is complete so the TNLP can store/write the solution.

Implements Ipopt::TNLP.

◆ intermediate_callback()

virtual bool Bonmin::TMINLP2TNLP::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 )
virtual

Intermediate Callback method for the user.

Providing dummy default implementation. For details see IntermediateCallBack in IpNLP.hpp.

◆ SetWarmStarter()

void Bonmin::TMINLP2TNLP::SetWarmStarter ( Ipopt::SmartPtr< IpoptInteriorWarmStarter > warm_starter)

◆ GetWarmStarter()

Ipopt::SmartPtr< IpoptInteriorWarmStarter > Bonmin::TMINLP2TNLP::GetWarmStarter ( )

◆ hasUpperBoundingObjective()

virtual bool Bonmin::TMINLP2TNLP::hasUpperBoundingObjective ( )
inlinevirtual

Say if has a specific function to compute upper bounds.

Definition at line 360 of file BonTMINLP2TNLP.hpp.

◆ evaluateUpperBoundingFunction()

double Bonmin::TMINLP2TNLP::evaluateUpperBoundingFunction ( const double * x)

Evaluate the upper bounding function at given point and store the result.

◆ addCuts() [1/2]

virtual void Bonmin::TMINLP2TNLP::addCuts ( unsigned int numberCuts,
const OsiRowCut ** cuts )
inlinevirtual

Methods are not implemented at this point.

But I need the interface. Add some linear cuts to the problem formulation (not implemented yet in base class).

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

Definition at line 372 of file BonTMINLP2TNLP.hpp.

◆ addCuts() [2/2]

virtual void Bonmin::TMINLP2TNLP::addCuts ( const OsiCuts & cuts)
inlinevirtual

Add some cuts to the problem formulaiton (handles Quadratics).

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

Definition at line 378 of file BonTMINLP2TNLP.hpp.

◆ removeCuts()

virtual void Bonmin::TMINLP2TNLP::removeCuts ( unsigned int number,
const int * toRemove )
inlinevirtual

Remove some cuts to the formulation.

Reimplemented in Bonmin::TMINLP2TNLPQuadCuts.

Definition at line 383 of file BonTMINLP2TNLP.hpp.

◆ get_const_xtra_id()

virtual const int * Bonmin::TMINLP2TNLP::get_const_xtra_id ( ) const
inlinevirtual

Access array describing constraint to which perspectives should be applied.

Definition at line 391 of file BonTMINLP2TNLP.hpp.

◆ check_solution()

double Bonmin::TMINLP2TNLP::check_solution ( OsiObject ** objects = 0,
int nObjects = -1 )

Round and check the current solution, return norm inf of constraint violation.

◆ nnz_h_lag() [2/2]

Ipopt::Index Bonmin::TMINLP2TNLP::nnz_h_lag ( ) const
inlineprotected

Access number of entries in tminlp_ hessian.

Definition at line 431 of file BonTMINLP2TNLP.hpp.

◆ nnz_jac_g()

Ipopt::Index Bonmin::TMINLP2TNLP::nnz_jac_g ( ) const
inlineprotected

Access number of entries in tminlp_ hessian.

Definition at line 434 of file BonTMINLP2TNLP.hpp.

◆ index_style()

TNLP::IndexStyleEnum Bonmin::TMINLP2TNLP::index_style ( ) const
inlineprotected

Acces index_style.

Definition at line 438 of file BonTMINLP2TNLP.hpp.

Member Data Documentation

◆ var_types_

vector<TMINLP::VariableType> Bonmin::TMINLP2TNLP::var_types_
protected

Types of the variable (TMINLP::CONTINUOUS, TMINLP::INTEGER, TMINLP::BINARY).

Definition at line 403 of file BonTMINLP2TNLP.hpp.

◆ x_l_

vector<Ipopt::Number> Bonmin::TMINLP2TNLP::x_l_
protected

Current lower bounds on variables.

Definition at line 405 of file BonTMINLP2TNLP.hpp.

◆ x_u_

vector<Ipopt::Number> Bonmin::TMINLP2TNLP::x_u_
protected

Current upper bounds on variables.

Definition at line 407 of file BonTMINLP2TNLP.hpp.

◆ orig_x_l_

vector<Ipopt::Number> Bonmin::TMINLP2TNLP::orig_x_l_
protected

Original lower bounds on variables.

Definition at line 409 of file BonTMINLP2TNLP.hpp.

◆ orig_x_u_

vector<Ipopt::Number> Bonmin::TMINLP2TNLP::orig_x_u_
protected

Original upper bounds on variables.

Definition at line 411 of file BonTMINLP2TNLP.hpp.

◆ g_l_

vector<Ipopt::Number> Bonmin::TMINLP2TNLP::g_l_
protected

Lower bounds on constraints values.

Definition at line 413 of file BonTMINLP2TNLP.hpp.

◆ g_u_

vector<Ipopt::Number> Bonmin::TMINLP2TNLP::g_u_
protected

Upper bounds on constraints values.

Definition at line 415 of file BonTMINLP2TNLP.hpp.

◆ x_init_

vector<Ipopt::Number> Bonmin::TMINLP2TNLP::x_init_
protected

Initial primal point.

Definition at line 417 of file BonTMINLP2TNLP.hpp.

◆ duals_init_

Ipopt::Number* Bonmin::TMINLP2TNLP::duals_init_
protected

Initial values for all dual multipliers (constraints then lower bounds then upper bounds)

Definition at line 419 of file BonTMINLP2TNLP.hpp.

◆ x_init_user_

vector<Ipopt::Number> Bonmin::TMINLP2TNLP::x_init_user_
protected

User-provideed initial prmal point.

Definition at line 421 of file BonTMINLP2TNLP.hpp.

◆ x_sol_

vector<Ipopt::Number> Bonmin::TMINLP2TNLP::x_sol_
protected

Optimal solution.

Definition at line 423 of file BonTMINLP2TNLP.hpp.

◆ g_sol_

vector<Ipopt::Number> Bonmin::TMINLP2TNLP::g_sol_
protected

Activities of constraint g( x_sol_)

Definition at line 425 of file BonTMINLP2TNLP.hpp.

◆ duals_sol_

vector<Ipopt::Number> Bonmin::TMINLP2TNLP::duals_sol_
protected

Dual multipliers of constraints and bounds.

Definition at line 427 of file BonTMINLP2TNLP.hpp.


The documentation for this class was generated from the following file: