OS  2.10.2
Public Member Functions | Public Attributes | List of all members
BonminProblem Class Reference

#include <OSBonminSolver.h>

+ Inheritance diagram for BonminProblem:
+ Collaboration diagram for BonminProblem:

Public Member Functions

 BonminProblem (OSInstance *osinstance_, OSOption *osoption_)
 the BonminProblemclass constructor More...
 
virtual ~BonminProblem ()
 the BonminProblem class destructor More...
 
Overloaded functions specific to a TMINLP.

now for some pure Bonmin methods

virtual bool get_variables_types (Ipopt::Index n, VariableType *var_types)
 Pass the type of the variables (INTEGER, BINARY, CONTINUOUS) to the optimizer. More...
 
virtual bool get_variables_linearity (Ipopt::Index n, Ipopt::TNLP::LinearityType *var_types)
 Pass info about linear and nonlinear variables. More...
 
virtual bool get_constraints_linearity (Ipopt::Index m, Ipopt::TNLP::LinearityType *const_types)
 Pass the type of the constraints (LINEAR, NON_LINEAR) to the optimizer. More...
 
Overloaded functions defining a TNLP.

This group of function implement the various elements needed to define and solve a TNLP.

They are the same as those in a standard Ipopt NLP problem

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)
 Method to pass the main dimensions of the problem to Ipopt. More...
 
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)
 Bonmin specific methods for defining the nlp problem. More...
 
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 to return the starting point for the algorithm. More...
 
virtual bool eval_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value)
 Method to return the objective value. More...
 
virtual bool eval_grad_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f)
 Method to return the gradient of the objective. More...
 
virtual bool eval_g (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g)
 Method to return the constraint residuals. More...
 
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)
 Method to return: 1) The structure of the jacobian (if "values" is NULL) 2) The values of the jacobian (if "values" is not NULL) More...
 
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)
 Method to return: 1) The structure of the hessian of the lagrangian (if "values" is NULL) 2) The values of the hessian of the lagrangian (if "values" is not NULL) More...
 
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)
 
- Public Member Functions inherited from Bonmin::TMINLP
 TMINLP ()
 
virtual ~TMINLP ()
 
virtual bool eval_gi (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index i, Ipopt::Number &gi)
 
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)
 
 TMINLP ()
 
virtual ~TMINLP ()
 
virtual bool eval_gi (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index i, Ipopt::Number &gi)
 
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)
 
virtual const PerturbInfo * perturbInfo () const
 
virtual bool hasUpperBoundingObjective ()
 
virtual bool eval_upper_bound_f (Ipopt::Index n, const Ipopt::Number *x, Ipopt::Number &obj_value)
 
virtual bool get_constraint_convexities (int m, TMINLP::Convexity *constraints_convexities) const
 
virtual bool get_number_nonconvex (int &number_non_conv, int &number_concave) const
 
virtual bool get_constraint_convexities (int number_non_conv, MarkedNonConvex *non_convs) const
 
virtual bool get_simple_concave_constraints (int number_concave, SimpleConcaveConstraint *simple_concave) const
 
virtual bool hasLinearObjective ()
 
bool hasGeneralInteger ()
 
virtual const int * get_const_xtra_id () 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
 

Public Attributes

OSInstanceosinstance
 
OSOptionosoption
 
Bonmin::TMINLP::SolverReturn status
 
- Public Attributes inherited from Bonmin::TMINLP
 SUCCESS
 
 INFEASIBLE
 
 CONTINUOUS_UNBOUNDED
 
 LIMIT_EXCEEDED
 
 USER_INTERRUPT
 
 MINLP_ERROR
 
 CONTINUOUS
 
 BINARY
 
 INTEGER
 
 Convex
 
 NonConvex
 
 SimpleConcave
 

Solution Methods

virtual void finalize_solution (Bonmin::TMINLP::SolverReturn status_, Ipopt::Index n, const Ipopt::Number *x, Ipopt::Number obj_value)
 Method called by Ipopt at the end of optimization. More...
 
virtual const SosInfo * sosConstraints () const
 
virtual const BranchingInfo * branchingInfo () const
 
void printSolutionAtEndOfAlgorithm ()
 

Additional Inherited Members

- Public Types inherited from Bonmin::TMINLP
enum  SolverReturn
 
enum  VariableType
 
enum  Convexity
 
- Protected Member Functions inherited from Bonmin::TMINLP
 TMINLP (const TMINLP &)
 
void operator= (const TMINLP &)
 

Detailed Description

Definition at line 53 of file OSBonminSolver.h.

Constructor & Destructor Documentation

◆ BonminProblem()

BonminProblem::BonminProblem ( OSInstance osinstance_,
OSOption osoption_ 
)

the BonminProblemclass constructor

◆ ~BonminProblem()

virtual BonminProblem::~BonminProblem ( )
virtual

the BonminProblem class destructor

Member Function Documentation

◆ get_variables_types()

virtual bool BonminProblem::get_variables_types ( Ipopt::Index  n,
VariableType var_types 
)
virtual

Pass the type of the variables (INTEGER, BINARY, CONTINUOUS) to the optimizer.

Parameters
nsize of var_types (has to be equal to the number of variables in the problem)
var_typestypes of the variables (has to be filled by function).

Implements Bonmin::TMINLP.

◆ get_variables_linearity()

virtual bool BonminProblem::get_variables_linearity ( Ipopt::Index  n,
Ipopt::TNLP::LinearityType var_types 
)
virtual

Pass info about linear and nonlinear variables.

Implements Bonmin::TMINLP.

◆ get_constraints_linearity()

virtual bool BonminProblem::get_constraints_linearity ( Ipopt::Index  m,
Ipopt::TNLP::LinearityType const_types 
)
virtual

Pass the type of the constraints (LINEAR, NON_LINEAR) to the optimizer.

Parameters
msize of const_types (has to be equal to the number of constraints in the problem)
const_typestypes of the constraints (has to be filled by function).

Implements Bonmin::TMINLP.

◆ get_nlp_info()

virtual bool BonminProblem::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

Method to pass the main dimensions of the problem to Ipopt.

Parameters
nnumber of variables in problem.
mnumber of constraints.
nnz_jac_gnumber of nonzeroes in Jacobian of constraints system.
nnz_h_lagnumber of nonzeroes in Hessian of the Lagrangean.
index_styleindicate wether arrays are numbered from 0 (C-style) or from 1 (Fortran).
Returns
true in case of success.

Implements Bonmin::TMINLP.

◆ get_bounds_info()

virtual bool BonminProblem::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

Bonmin specific methods for defining the nlp problem.

Method to return the bounds for my problem

Implements Bonmin::TMINLP.

◆ get_starting_point()

virtual bool BonminProblem::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 to return the starting point for the algorithm.

Implements Bonmin::TMINLP.

◆ eval_f()

virtual bool BonminProblem::eval_f ( Ipopt::Index  n,
const Ipopt::Number x,
bool  new_x,
Ipopt::Number obj_value 
)
virtual

Method to return the objective value.

Implements Bonmin::TMINLP.

◆ eval_grad_f()

virtual bool BonminProblem::eval_grad_f ( Ipopt::Index  n,
const Ipopt::Number x,
bool  new_x,
Ipopt::Number grad_f 
)
virtual

Method to return the gradient of the objective.

Implements Bonmin::TMINLP.

◆ eval_g()

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

Method to return the constraint residuals.

Implements Bonmin::TMINLP.

◆ eval_jac_g()

virtual bool BonminProblem::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

Method to return: 1) The structure of the jacobian (if "values" is NULL) 2) The values of the jacobian (if "values" is not NULL)

Implements Bonmin::TMINLP.

◆ eval_h()

virtual bool BonminProblem::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

Method to return: 1) The structure of the hessian of the lagrangian (if "values" is NULL) 2) The values of the hessian of the lagrangian (if "values" is not NULL)

Implements Bonmin::TMINLP.

◆ get_scaling_parameters()

virtual bool BonminProblem::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

Reimplemented from Bonmin::TMINLP.

◆ finalize_solution()

virtual void BonminProblem::finalize_solution ( Bonmin::TMINLP::SolverReturn  status_,
Ipopt::Index  n,
const Ipopt::Number x,
Ipopt::Number  obj_value 
)
virtual

Method called by Ipopt at the end of optimization.

Implements Bonmin::TMINLP.

◆ sosConstraints()

virtual const SosInfo* BonminProblem::sosConstraints ( ) const
inlinevirtual

Implements Bonmin::TMINLP.

Definition at line 166 of file OSBonminSolver.h.

◆ branchingInfo()

virtual const BranchingInfo* BonminProblem::branchingInfo ( ) const
inlinevirtual

Implements Bonmin::TMINLP.

Definition at line 170 of file OSBonminSolver.h.

◆ printSolutionAtEndOfAlgorithm()

void BonminProblem::printSolutionAtEndOfAlgorithm ( )
inline

Definition at line 175 of file OSBonminSolver.h.

Member Data Documentation

◆ osinstance

OSInstance* BonminProblem::osinstance

Definition at line 66 of file OSBonminSolver.h.

◆ osoption

OSOption* BonminProblem::osoption

Definition at line 68 of file OSBonminSolver.h.

◆ status

Bonmin::TMINLP::SolverReturn BonminProblem::status

Definition at line 70 of file OSBonminSolver.h.


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