#include <OSBonminSolver.h>
Public Member Functions | |
BonminProblem (OSInstance *osinstance_, OSOption *osoption_) | |
the BonminProblemclass constructor More... | |
virtual | ~BonminProblem () |
the BonminProblem class destructor 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) |
overload this method to return scaling parameters. More... | |
virtual const SosInfo * | sosConstraints () const |
virtual const BranchingInfo * | branchingInfo () const |
void | printSolutionAtEndOfAlgorithm () |
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... | |
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 PerturbInfo * | perturbInfo () const |
virtual bool | hasUpperBoundingObjective () |
Say if has a specific function to compute upper bounds. More... | |
virtual bool | eval_upper_bound_f (Ipopt::Index n, const Ipopt::Number *x, Ipopt::Number &obj_value) |
overload this method to return the value of an alternative objective function for upper bounding (to use it hasUpperBoundingObjective should return true). More... | |
virtual bool | get_constraint_convexities (int m, TMINLP::Convexity *constraints_convexities) const |
Get accest to constraint convexities. More... | |
virtual bool | get_number_nonconvex (int &number_non_conv, int &number_concave) const |
Get dimension information on nonconvex constraints. More... | |
virtual bool | get_constraint_convexities (int number_non_conv, MarkedNonConvex *non_convs) const |
Get array describing the constraints marked nonconvex in the model. More... | |
virtual bool | get_simple_concave_constraints (int number_concave, SimpleConcaveConstraint *simple_concave) const |
Fill array containing indices of simple concave constraints. More... | |
virtual bool | hasLinearObjective () |
Say if problem has a linear objective (for OA) More... | |
bool | hasGeneralInteger () |
Say if problem has general integer variables. More... | |
virtual const int * | get_const_xtra_id () const |
Access array describing constraint to which perspectives should be applied. More... | |
TMINLP () | |
Default destructor. More... | |
virtual | ~TMINLP () |
Default destructor. More... | |
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. More... | |
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. More... | |
Public Attributes | |
OSInstance * | osinstance |
OSOption * | osoption |
Bonmin::TMINLP::SolverReturn | status |
Private Attributes | |
bool | printSol_ |
std::string | bonminErrorMsg |
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. More... | |
void | operator= (const TMINLP &) |
Overloaded Equals Operator. More... | |
Definition at line 53 of file OSBonminSolver.h.
BonminProblem::BonminProblem | ( | OSInstance * | osinstance_, |
OSOption * | osoption_ | ||
) |
the BonminProblemclass constructor
Definition at line 1152 of file OSBonminSolver.cpp.
|
virtual |
the BonminProblem class destructor
Definition at line 1159 of file OSBonminSolver.cpp.
|
virtual |
Pass the type of the variables (INTEGER, BINARY, CONTINUOUS) to the optimizer.
n | size of var_types (has to be equal to the number of variables in the problem) |
var_types | types of the variables (has to be filled by function). |
Implements Bonmin::TMINLP.
Definition at line 68 of file OSBonminSolver.cpp.
|
virtual |
Pass info about linear and nonlinear variables.
get an index map of the nonlinear variables and see which variable are in <nonlinearExpressions> element
iterate through and get an index of all variables that are in <nonlinearExpressions> element
Implements Bonmin::TMINLP.
Definition at line 103 of file OSBonminSolver.cpp.
|
virtual |
Pass the type of the constraints (LINEAR, NON_LINEAR) to the optimizer.
m | size of const_types (has to be equal to the number of constraints in the problem) |
const_types | types of the constraints (has to be filled by function). |
Implements Bonmin::TMINLP.
Definition at line 149 of file OSBonminSolver.cpp.
|
virtual |
Method to pass the main dimensions of the problem to Ipopt.
n | number of variables in problem. |
m | number of constraints. |
nnz_jac_g | number of nonzeroes in Jacobian of constraints system. |
nnz_h_lag | number of nonzeroes in Hessian of the Lagrangean. |
index_style | indicate wether arrays are numbered from 0 (C-style) or from 1 (Fortran). |
Implements Bonmin::TMINLP.
Definition at line 177 of file OSBonminSolver.cpp.
|
virtual |
Bonmin specific methods for defining the nlp problem.
Method to return the bounds for my problem
Implements Bonmin::TMINLP.
Definition at line 246 of file OSBonminSolver.cpp.
|
virtual |
Method to return the starting point for the algorithm.
Implements Bonmin::TMINLP.
Definition at line 295 of file OSBonminSolver.cpp.
|
virtual |
Method to return the objective value.
Implements Bonmin::TMINLP.
Definition at line 439 of file OSBonminSolver.cpp.
|
virtual |
Method to return the gradient of the objective.
Implements Bonmin::TMINLP.
Definition at line 465 of file OSBonminSolver.cpp.
|
virtual |
Method to return the constraint residuals.
Implements Bonmin::TMINLP.
Definition at line 498 of file OSBonminSolver.cpp.
|
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.
Definition at line 520 of file OSBonminSolver.cpp.
|
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.
Definition at line 571 of file OSBonminSolver.cpp.
|
virtual |
overload this method to return scaling parameters.
This is only called if the options are set to retrieve user scaling. There, use_x_scaling (or use_g_scaling) should get set to true only if the variables (or constraints) are to be scaled. This method should return true only if the scaling parameters could be provided.
Reimplemented from Bonmin::TMINLP.
Definition at line 623 of file OSBonminSolver.cpp.
|
virtual |
Method called by Ipopt at the end of optimization.
Implements Bonmin::TMINLP.
Definition at line 644 of file OSBonminSolver.cpp.
|
inlinevirtual |
Implements Bonmin::TMINLP.
Definition at line 166 of file OSBonminSolver.h.
|
inlinevirtual |
Implements Bonmin::TMINLP.
Definition at line 170 of file OSBonminSolver.h.
|
inline |
Definition at line 175 of file OSBonminSolver.h.
OSInstance* BonminProblem::osinstance |
Definition at line 66 of file OSBonminSolver.h.
OSOption* BonminProblem::osoption |
Definition at line 68 of file OSBonminSolver.h.
Bonmin::TMINLP::SolverReturn BonminProblem::status |
Definition at line 70 of file OSBonminSolver.h.
|
private |
Definition at line 185 of file OSBonminSolver.h.
|
private |
Definition at line 205 of file OSBonminSolver.h.