21#include "OSInstance.h"
22#include "OSParameters.h"
27#include "OSInstance.h"
35#include "OSInstance.h"
49#include "BonTMINLP.hpp"
50#include "BonBonminSetup.hpp"
106 virtual bool get_nlp_info(Ipopt::Index& n, Ipopt::Index&m, Ipopt::Index& nnz_jac_g,
107 Ipopt::Index& nnz_h_lag, Ipopt::TNLP::IndexStyleEnum& index_style);
116 virtual bool get_bounds_info(Ipopt::Index n, Ipopt::Number* x_l, Ipopt::Number* x_u,
117 Ipopt::Index m, Ipopt::Number* g_l, Ipopt::Number* g_u);
121 bool init_z, Ipopt::Number* z_L, Ipopt::Number* z_U,
122 Ipopt::Index m,
bool init_lambda,
123 Ipopt::Number* lambda);
126 virtual bool eval_f(Ipopt::Index n,
const Ipopt::Number* x,
bool new_x, Ipopt::Number& obj_value);
129 virtual bool eval_grad_f(Ipopt::Index n,
const Ipopt::Number* x,
bool new_x, Ipopt::Number* grad_f);
132 virtual bool eval_g(Ipopt::Index n,
const Ipopt::Number* x,
bool new_x, Ipopt::Index m, Ipopt::Number* g);
138 virtual bool eval_jac_g(Ipopt::Index n,
const Ipopt::Number* x,
bool new_x,
139 Ipopt::Index m, Ipopt::Index nele_jac, Ipopt::Index* iRow, Ipopt::Index *jCol,
140 Ipopt::Number* values);
146 virtual bool eval_h(Ipopt::Index n,
const Ipopt::Number* x,
bool new_x,
147 Ipopt::Number obj_factor, Ipopt::Index m,
const Ipopt::Number* lambda,
148 bool new_lambda, Ipopt::Index nele_hess, Ipopt::Index* iRow,
149 Ipopt::Index* jCol, Ipopt::Number* values);
155 bool& use_x_scaling, Ipopt::Index n,
156 Ipopt::Number* x_scaling,
157 bool& use_g_scaling, Ipopt::Index m,
158 Ipopt::Number* g_scaling);
163 Ipopt::Index n,
const Ipopt::Number* x, Ipopt::Number obj_value);
251 virtual void solve();
This file defines the OSnLNode class along with its derived classes.
bool printSol_
Method called by Ipopt at the end of optimization.
virtual ~BonminProblem()
the BonminProblem class destructor
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.
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.
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.
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.
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.
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.
virtual bool get_variables_types(Ipopt::Index n, VariableType *var_types)
Pass the type of the variables (INTEGER, BINARY, CONTINUOUS) to the optimizer.
virtual bool eval_f(Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value)
Method to return the objective value.
virtual bool get_variables_linearity(Ipopt::Index n, Ipopt::TNLP::LinearityType *var_types)
Pass info about linear and nonlinear variables.
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.
virtual const BranchingInfo * branchingInfo() const
Method called by Ipopt at the end of optimization.
std::string bonminErrorMsg
Bonmin::TMINLP::SolverReturn status
void printSolutionAtEndOfAlgorithm()
Method called by Ipopt at the end of optimization.
BonminProblem(OSInstance *osinstance_, OSOption *osoption_)
the BonminProblemclass constructor
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 valu...
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 to pass the main dimensions of the problem to Ipopt.
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 jacobia...
virtual const SosInfo * sosConstraints() const
Method called by Ipopt at the end of optimization.
The BonminSolver class solves problems using Ipopt.
Bonmin::TMINLP::SolverReturn status
std::string bonminErrorMsg
Ipopt::SmartPtr< BonminProblem > tminlp
virtual void setSolverOptions()
The implementation of the virtual functions.
virtual void buildSolverInstance()
buildSolverInstance is a virtual function – the actual solvers will implement their own buildSolverIn...
void dataEchoCheck()
use this for debugging, print out the instance that the solver thinks it has and compare this with th...
Bonmin::BonminSetup bonminSetup
OSiLReader * m_osilreader
m_osilreader is an OSiLReader object used to create an osinstance from an osil string if needed
void writeResult()
use this to write the solution information to an OSResult object
OSoLReader * m_osolreader
m_osolreader is an OSoLReader object used to create an osoption from an osol string if needed
~BonminSolver()
the IpoptSolver class destructor
virtual void solve()
solve results in an instance being read into the Bonmin data structrues and optimized
BonminSolver()
the BonminSolver class constructor
The Default Solver Class.
The in-memory representation of an OSiL instance..
Used to read an OSiL string.
Used to read an OSoL string.
Take an OSResult object and write a string that validates against OSrL.