A very simple class to provide a common interface for solving MIPs with Cplex and Cbc. More...
#include <BonSubMipSolver.hpp>
Public Types | |
enum | MILP_solve_strategy { FindGoodSolution, GetOptimum } |
Public Member Functions | |
SubMipSolver (BabSetupBase &b, const std::string &prefix) | |
Constructor. More... | |
SubMipSolver (const SubMipSolver ©) | |
Copy Constructor. More... | |
~SubMipSolver () | |
void | setLpSolver (OsiSolverInterface *lp) |
Assign lp solver. More... | |
void | setStrategy (CbcStrategyDefault *strategy) |
Assign a strategy. More... | |
const double * | getLastSolution () |
get the solution found in last local search (return NULL if no solution). More... | |
double | getLowerBound () |
void | solve (double cutoff, int loglevel, double maxTime) |
void | find_good_sol (double cutoff, int loglevel, double maxTime) |
update cutoff and perform a local search to a good solution. More... | |
void | optimize (double cutoff, int loglevel, double maxTime) |
update cutoff and optimize MIP. More... | |
void | optimize_with_lazy_constraints (double cutoff, int loglevel, double maxTime, const OsiCuts &cs) |
update cutoff, put OA constraints in cs as lazy constraints and optimize MIP. More... | |
double | lowBound () |
Returns lower bound. More... | |
bool | optimal () |
returns optimality status. More... | |
int | nodeCount () |
Returns number of nodes in last solve. More... | |
int | iterationCount () |
Returns number of simplex iterations in last solve. More... | |
OsiSolverInterface * | solver () |
Static Public Member Functions | |
static void | registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions) |
Register options for that Oa based cut generation method. More... | |
Private Attributes | |
OsiClpSolverInterface * | clp_ |
If lp solver is clp (then have to use Cbc) (not owned). More... | |
OsiCpxSolverInterface * | cpx_ |
If mip solver is cpx this is it (owned). More... | |
double | lowBound_ |
lower bound obtained More... | |
bool | optimal_ |
Is optimality proven? More... | |
double * | integerSolution_ |
Has an integer solution? then it is here. More... | |
CbcStrategyDefault * | strategy_ |
Strategy for solving sub mips with cbc. More... | |
int | nodeCount_ |
number of nodes in last mip solved. More... | |
int | iterationCount_ |
number of simplex iteration in last mip solved. More... | |
MILP_solve_strategy | milp_strat_ |
MILP search strategy. More... | |
double | gap_tol_ |
setting for gap tolerance. More... | |
bool | ownClp_ |
say if owns copy of clp_. More... | |
A very simple class to provide a common interface for solving MIPs with Cplex and Cbc.
Definition at line 29 of file BonSubMipSolver.hpp.
Enumerator | |
---|---|
FindGoodSolution | |
GetOptimum |
Definition at line 32 of file BonSubMipSolver.hpp.
Bonmin::SubMipSolver::SubMipSolver | ( | BabSetupBase & | b, |
const std::string & | prefix | ||
) |
Constructor.
Definition at line 37 of file BonSubMipSolver.cpp.
Bonmin::SubMipSolver::SubMipSolver | ( | const SubMipSolver & | copy | ) |
Copy Constructor.
Definition at line 98 of file BonSubMipSolver.cpp.
Bonmin::SubMipSolver::~SubMipSolver | ( | ) |
Definition at line 128 of file BonSubMipSolver.cpp.
void Bonmin::SubMipSolver::setLpSolver | ( | OsiSolverInterface * | lp | ) |
Assign lp solver.
Definition at line 140 of file BonSubMipSolver.cpp.
void Bonmin::SubMipSolver::setStrategy | ( | CbcStrategyDefault * | strategy | ) |
Assign a strategy.
Definition at line 542 of file BonSubMipSolver.cpp.
|
inline |
get the solution found in last local search (return NULL if no solution).
Definition at line 50 of file BonSubMipSolver.hpp.
|
inline |
Definition at line 55 of file BonSubMipSolver.hpp.
Definition at line 60 of file BonSubMipSolver.hpp.
update cutoff and perform a local search to a good solution.
Definition at line 185 of file BonSubMipSolver.cpp.
update cutoff and optimize MIP.
Definition at line 320 of file BonSubMipSolver.cpp.
void Bonmin::SubMipSolver::optimize_with_lazy_constraints | ( | double | cutoff, |
int | loglevel, | ||
double | maxTime, | ||
const OsiCuts & | cs | ||
) |
update cutoff, put OA constraints in cs as lazy constraints and optimize MIP.
Definition at line 435 of file BonSubMipSolver.cpp.
|
inline |
Returns lower bound.
Definition at line 87 of file BonSubMipSolver.hpp.
|
inline |
returns optimality status.
Definition at line 93 of file BonSubMipSolver.hpp.
|
inline |
Returns number of nodes in last solve.
Definition at line 99 of file BonSubMipSolver.hpp.
|
inline |
Returns number of simplex iterations in last solve.
Definition at line 105 of file BonSubMipSolver.hpp.
OsiSolverInterface * Bonmin::SubMipSolver::solver | ( | ) |
Definition at line 173 of file BonSubMipSolver.cpp.
|
static |
Register options for that Oa based cut generation method.
Register options.
Definition at line 551 of file BonSubMipSolver.cpp.
|
private |
If lp solver is clp (then have to use Cbc) (not owned).
Definition at line 117 of file BonSubMipSolver.hpp.
|
private |
If mip solver is cpx this is it (owned).
Definition at line 119 of file BonSubMipSolver.hpp.
|
private |
lower bound obtained
Definition at line 121 of file BonSubMipSolver.hpp.
|
private |
Is optimality proven?
Definition at line 123 of file BonSubMipSolver.hpp.
|
private |
Has an integer solution? then it is here.
Definition at line 125 of file BonSubMipSolver.hpp.
|
private |
Strategy for solving sub mips with cbc.
Definition at line 127 of file BonSubMipSolver.hpp.
|
private |
number of nodes in last mip solved.
Definition at line 129 of file BonSubMipSolver.hpp.
|
private |
number of simplex iteration in last mip solved.
Definition at line 131 of file BonSubMipSolver.hpp.
|
private |
MILP search strategy.
Definition at line 133 of file BonSubMipSolver.hpp.
|
private |
setting for gap tolerance.
Definition at line 135 of file BonSubMipSolver.hpp.
|
private |
say if owns copy of clp_.
Definition at line 137 of file BonSubMipSolver.hpp.