#include <BonSubMipSolver.hpp>
Public Member Functions | |
SubMipSolver (OsiSolverInterface *lp=0, const CbcStrategy *strategy=0) | |
Constructor. | |
~SubMipSolver () | |
void | setLpSolver (OsiSolverInterface *lp) |
Assign lp solver. | |
void | setStrategy (CbcStrategyDefault *strategy) |
Assign a strategy. | |
const double * | getLastSolution () |
get the solution found in last local search (return NULL if no solution). | |
double | getLowerBound () |
void | find_good_sol (double cutoff, int loglevel, double maxTime) |
update cutoff and perform a local search to a good solution. | |
void | optimize (double cutoff, int loglevel, double maxTime) |
update cutoff and optimize MIP. | |
double | lowBound () |
Returns lower bound. | |
bool | optimal () |
returns optimality status. | |
int | nodeCount () |
Returns number of nodes in last solve. | |
int | iterationCount () |
Returns number of simplex iterations in last solve. | |
OsiSolverInterface * | solver () |
Register options for that Oa based cut generation method. | |
Static Public Member Functions | |
static void | registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions) |
Register options. | |
Private Attributes | |
OsiSolverInterface * | lp_ |
lp (potentially mip solver). | |
OsiClpSolverInterface * | clp_ |
If lp solver is clp (then have to use Cbc). | |
OsiCpxSolverInterface * | cpx_ |
If lp solver is cpx this points to it. | |
CbcModel * | cbc_ |
If cbc is used pointer to CbcModel. | |
double | lowBound_ |
lower bound obtained | |
bool | optimal_ |
Is optimality proven? | |
double * | integerSolution_ |
Has an integer solution? then it is here. | |
CbcStrategyDefault * | strategy_ |
Strategy for solving sub mips with cbc. | |
int | nodeCount_ |
number of nodes in last mip solved. | |
int | iterationCount_ |
number of simplex iteration in last mip solved. |
Definition at line 26 of file BonSubMipSolver.hpp.
Bonmin::SubMipSolver::SubMipSolver | ( | OsiSolverInterface * | lp = 0 , |
|
const CbcStrategy * | strategy = 0 | |||
) |
Bonmin::SubMipSolver::~SubMipSolver | ( | ) |
Definition at line 51 of file BonSubMipSolver.cpp.
References cbc_, integerSolution_, and strategy_.
void Bonmin::SubMipSolver::setLpSolver | ( | OsiSolverInterface * | lp | ) |
Assign lp solver.
Definition at line 60 of file BonSubMipSolver.cpp.
References clp_, cpx_, integerSolution_, lowBound_, lp_, and optimal_.
void Bonmin::SubMipSolver::setStrategy | ( | CbcStrategyDefault * | strategy | ) |
const double* Bonmin::SubMipSolver::getLastSolution | ( | ) | [inline] |
get the solution found in last local search (return NULL if no solution).
Definition at line 42 of file BonSubMipSolver.hpp.
References integerSolution_.
Referenced by Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), and Bonmin::HeuristicDiveMIP::solution().
double Bonmin::SubMipSolver::getLowerBound | ( | ) | [inline] |
void Bonmin::SubMipSolver::find_good_sol | ( | double | cutoff, | |
int | loglevel, | |||
double | maxTime | |||
) |
update cutoff and perform a local search to a good solution.
Definition at line 79 of file BonSubMipSolver.cpp.
References cbc_, clp_, cpx_, e, infeasible, integerSolution_, iterationCount_, lowBound_, lp_, nodeCount_, optimal_, and strategy_.
Referenced by Bonmin::OACutGenerator2::performOa(), and Bonmin::MinlpFeasPump::performOa().
void Bonmin::SubMipSolver::optimize | ( | double | cutoff, | |
int | loglevel, | |||
double | maxTime | |||
) |
update cutoff and optimize MIP.
Definition at line 216 of file BonSubMipSolver.cpp.
References cbc_, clp_, cpx_, infeasible, integerSolution_, iterationCount_, lowBound_, lp_, nodeCount_, optimal_, and strategy_.
Referenced by Bonmin::HeuristicDiveMIP::solution().
double Bonmin::SubMipSolver::lowBound | ( | ) | [inline] |
Returns lower bound.
Definition at line 62 of file BonSubMipSolver.hpp.
References lowBound_.
Referenced by Bonmin::OACutGenerator2::performOa().
bool Bonmin::SubMipSolver::optimal | ( | ) | [inline] |
returns optimality status.
Definition at line 68 of file BonSubMipSolver.hpp.
References optimal_.
Referenced by Bonmin::OACutGenerator2::performOa().
int Bonmin::SubMipSolver::nodeCount | ( | ) | [inline] |
Returns number of nodes in last solve.
Definition at line 74 of file BonSubMipSolver.hpp.
References nodeCount_.
Referenced by Bonmin::OACutGenerator2::performOa(), and Bonmin::MinlpFeasPump::performOa().
int Bonmin::SubMipSolver::iterationCount | ( | ) | [inline] |
Returns number of simplex iterations in last solve.
Definition at line 80 of file BonSubMipSolver.hpp.
References iterationCount_.
Referenced by Bonmin::OACutGenerator2::performOa(), and Bonmin::MinlpFeasPump::performOa().
OsiSolverInterface* Bonmin::SubMipSolver::solver | ( | ) | [inline] |
Register options for that Oa based cut generation method.
Definition at line 87 of file BonSubMipSolver.hpp.
References lp_.
Referenced by Bonmin::MinlpFeasPump::performOa().
void Bonmin::SubMipSolver::registerOptions | ( | Ipopt::SmartPtr< Bonmin::RegisteredOptions > | roptions | ) | [static] |
Register options.
Definition at line 346 of file BonSubMipSolver.cpp.
References Bonmin::RegisteredOptions::BonminCategory.
Referenced by Bonmin::BonminSetup::registerAllOptions().
OsiSolverInterface* Bonmin::SubMipSolver::lp_ [private] |
lp (potentially mip solver).
Definition at line 93 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), optimize(), setLpSolver(), solver(), and SubMipSolver().
OsiClpSolverInterface* Bonmin::SubMipSolver::clp_ [private] |
If lp solver is clp (then have to use Cbc).
Definition at line 95 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), optimize(), setLpSolver(), and SubMipSolver().
OsiCpxSolverInterface* Bonmin::SubMipSolver::cpx_ [private] |
If lp solver is cpx this points to it.
Definition at line 97 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), optimize(), setLpSolver(), and SubMipSolver().
CbcModel* Bonmin::SubMipSolver::cbc_ [private] |
If cbc is used pointer to CbcModel.
Definition at line 99 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), optimize(), and ~SubMipSolver().
double Bonmin::SubMipSolver::lowBound_ [private] |
lower bound obtained
Definition at line 101 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), getLowerBound(), lowBound(), optimize(), and setLpSolver().
bool Bonmin::SubMipSolver::optimal_ [private] |
Is optimality proven?
Definition at line 103 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), optimal(), optimize(), and setLpSolver().
double* Bonmin::SubMipSolver::integerSolution_ [private] |
Has an integer solution? then it is here.
Definition at line 105 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), getLastSolution(), optimize(), setLpSolver(), and ~SubMipSolver().
CbcStrategyDefault* Bonmin::SubMipSolver::strategy_ [private] |
Strategy for solving sub mips with cbc.
Definition at line 107 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), optimize(), setStrategy(), SubMipSolver(), and ~SubMipSolver().
int Bonmin::SubMipSolver::nodeCount_ [private] |
number of nodes in last mip solved.
Definition at line 109 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), nodeCount(), and optimize().
int Bonmin::SubMipSolver::iterationCount_ [private] |
number of simplex iteration in last mip solved.
Definition at line 111 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), iterationCount(), and optimize().