#include <BonSubMipSolver.hpp>
Public Types | |
FindGoodSolution | |
GetOptimum | |
enum | MILP_solve_strategy { FindGoodSolution, GetOptimum } |
Public Member Functions | |
SubMipSolver (BabSetupBase &b, const std::string &prefix) | |
Constructor. | |
SubMipSolver (const SubMipSolver ©) | |
Copy 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 | 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. | |
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 () |
Static Public Member Functions | |
static void | registerOptions (Ipopt::SmartPtr< Bonmin::RegisteredOptions > roptions) |
Register options. | |
Private Attributes | |
OsiClpSolverInterface * | clp_ |
If lp solver is clp (then have to use Cbc) (not owned). | |
OsiCpxSolverInterface * | cpx_ |
If mip solver is cpx this is it (owned). | |
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. | |
MILP_solve_strategy | milp_strat_ |
MILP search strategy. | |
double | gap_tol_ |
setting for gap tolerance. | |
bool | ownClp_ |
say if owns copy of clp_. |
Definition at line 27 of file BonSubMipSolver.hpp.
Bonmin::SubMipSolver::SubMipSolver | ( | BabSetupBase & | b, | |
const std::string & | prefix | |||
) |
Constructor.
Definition at line 36 of file BonSubMipSolver.cpp.
References clp_, cpx_, FindGoodSolution, gap_tol_, GetOptimum, milp_strat_, Bonmin::BabSetupBase::options(), ownClp_, and strategy_.
Bonmin::SubMipSolver::SubMipSolver | ( | const SubMipSolver & | copy | ) |
Bonmin::SubMipSolver::~SubMipSolver | ( | ) |
Definition at line 119 of file BonSubMipSolver.cpp.
References clp_, cpx_, integerSolution_, ownClp_, and strategy_.
void Bonmin::SubMipSolver::setLpSolver | ( | OsiSolverInterface * | lp | ) |
Assign lp solver.
Definition at line 131 of file BonSubMipSolver.cpp.
References clp_, cpx_, integerSolution_, lowBound_, optimal_, and ownClp_.
Referenced by Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), Bonmin::HeuristicDiveMIP::solution(), and Bonmin::HeuristicInnerApproximation::solution().
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 48 of file BonSubMipSolver.hpp.
References integerSolution_.
Referenced by Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), Bonmin::MilpRounding::solution(), Bonmin::HeuristicDiveMIP::solution(), and Bonmin::HeuristicInnerApproximation::solution().
double Bonmin::SubMipSolver::getLowerBound | ( | ) | [inline] |
void Bonmin::SubMipSolver::solve | ( | double | cutoff, | |
int | loglevel, | |||
double | maxTime | |||
) | [inline] |
Definition at line 58 of file BonSubMipSolver.hpp.
References find_good_sol(), FindGoodSolution, milp_strat_, and optimize().
Referenced by Bonmin::OACutGenerator2::performOa(), and Bonmin::MinlpFeasPump::performOa().
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 176 of file BonSubMipSolver.cpp.
References clp_, cpx_, e, gap_tol_, infeasible, integerSolution_, iterationCount_, lowBound_, nodeCount_, optimal_, and strategy_.
Referenced by solve().
void Bonmin::SubMipSolver::optimize | ( | double | cutoff, | |
int | loglevel, | |||
double | maxTime | |||
) |
update cutoff and optimize MIP.
Definition at line 306 of file BonSubMipSolver.cpp.
References clp_, cpx_, gap_tol_, infeasible, integerSolution_, iterationCount_, lowBound_, nodeCount_, optimal_, and strategy_.
Referenced by Bonmin::MilpRounding::solution(), Bonmin::HeuristicDiveMIP::solution(), Bonmin::HeuristicInnerApproximation::solution(), and solve().
double Bonmin::SubMipSolver::lowBound | ( | ) | [inline] |
Returns lower bound.
Definition at line 80 of file BonSubMipSolver.hpp.
References lowBound_.
Referenced by Bonmin::OACutGenerator2::performOa().
bool Bonmin::SubMipSolver::optimal | ( | ) | [inline] |
returns optimality status.
Definition at line 86 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 92 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 98 of file BonSubMipSolver.hpp.
References iterationCount_.
Referenced by Bonmin::OACutGenerator2::performOa(), and Bonmin::MinlpFeasPump::performOa().
OsiSolverInterface * Bonmin::SubMipSolver::solver | ( | ) |
Definition at line 164 of file BonSubMipSolver.cpp.
Referenced by Bonmin::OACutGenerator2::performOa(), Bonmin::MinlpFeasPump::performOa(), Bonmin::MilpRounding::solution(), Bonmin::HeuristicDiveMIP::solution(), and Bonmin::HeuristicInnerApproximation::solution().
void Bonmin::SubMipSolver::registerOptions | ( | Ipopt::SmartPtr< Bonmin::RegisteredOptions > | roptions | ) | [static] |
Register options.
Definition at line 415 of file BonSubMipSolver.cpp.
References Bonmin::RegisteredOptions::BonminCategory.
Referenced by Bonmin::BonminSetup::registerAllOptions().
OsiClpSolverInterface* Bonmin::SubMipSolver::clp_ [private] |
If lp solver is clp (then have to use Cbc) (not owned).
Definition at line 110 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), optimize(), setLpSolver(), solver(), SubMipSolver(), and ~SubMipSolver().
OsiCpxSolverInterface* Bonmin::SubMipSolver::cpx_ [private] |
If mip solver is cpx this is it (owned).
Definition at line 112 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), optimize(), setLpSolver(), solver(), SubMipSolver(), and ~SubMipSolver().
double Bonmin::SubMipSolver::lowBound_ [private] |
lower bound obtained
Definition at line 114 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 116 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 118 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 120 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 122 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 124 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), iterationCount(), and optimize().
MILP search strategy.
Definition at line 126 of file BonSubMipSolver.hpp.
Referenced by solve(), and SubMipSolver().
double Bonmin::SubMipSolver::gap_tol_ [private] |
setting for gap tolerance.
Definition at line 128 of file BonSubMipSolver.hpp.
Referenced by find_good_sol(), optimize(), and SubMipSolver().
bool Bonmin::SubMipSolver::ownClp_ [private] |
say if owns copy of clp_.
Definition at line 130 of file BonSubMipSolver.hpp.
Referenced by setLpSolver(), SubMipSolver(), and ~SubMipSolver().