Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Bonmin::SubMipSolver Class Reference

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)
 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...
 

Detailed Description

A very simple class to provide a common interface for solving MIPs with Cplex and Cbc.

Definition at line 29 of file BonSubMipSolver.hpp.

Member Enumeration Documentation

Enumerator
FindGoodSolution 
GetOptimum 

Definition at line 32 of file BonSubMipSolver.hpp.

Constructor & Destructor Documentation

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.

Member Function Documentation

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.

const double* Bonmin::SubMipSolver::getLastSolution ( )
inline

get the solution found in last local search (return NULL if no solution).

Definition at line 50 of file BonSubMipSolver.hpp.

double Bonmin::SubMipSolver::getLowerBound ( )
inline

Definition at line 55 of file BonSubMipSolver.hpp.

void Bonmin::SubMipSolver::solve ( double  cutoff,
int  loglevel,
double  maxTime 
)
inline

Definition at line 60 of file BonSubMipSolver.hpp.

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 185 of file BonSubMipSolver.cpp.

void Bonmin::SubMipSolver::optimize ( double  cutoff,
int  loglevel,
double  maxTime 
)

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.

double Bonmin::SubMipSolver::lowBound ( )
inline

Returns lower bound.

Definition at line 87 of file BonSubMipSolver.hpp.

bool Bonmin::SubMipSolver::optimal ( )
inline

returns optimality status.

Definition at line 93 of file BonSubMipSolver.hpp.

int Bonmin::SubMipSolver::nodeCount ( )
inline

Returns number of nodes in last solve.

Definition at line 99 of file BonSubMipSolver.hpp.

int Bonmin::SubMipSolver::iterationCount ( )
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.

void Bonmin::SubMipSolver::registerOptions ( Ipopt::SmartPtr< Bonmin::RegisteredOptions roptions)
static

Register options for that Oa based cut generation method.

Register options.

Definition at line 551 of file BonSubMipSolver.cpp.

Member Data Documentation

OsiClpSolverInterface* Bonmin::SubMipSolver::clp_
private

If lp solver is clp (then have to use Cbc) (not owned).

Definition at line 117 of file BonSubMipSolver.hpp.

OsiCpxSolverInterface* Bonmin::SubMipSolver::cpx_
private

If mip solver is cpx this is it (owned).

Definition at line 119 of file BonSubMipSolver.hpp.

double Bonmin::SubMipSolver::lowBound_
private

lower bound obtained

Definition at line 121 of file BonSubMipSolver.hpp.

bool Bonmin::SubMipSolver::optimal_
private

Is optimality proven?

Definition at line 123 of file BonSubMipSolver.hpp.

double* Bonmin::SubMipSolver::integerSolution_
private

Has an integer solution? then it is here.

Definition at line 125 of file BonSubMipSolver.hpp.

CbcStrategyDefault* Bonmin::SubMipSolver::strategy_
private

Strategy for solving sub mips with cbc.

Definition at line 127 of file BonSubMipSolver.hpp.

int Bonmin::SubMipSolver::nodeCount_
private

number of nodes in last mip solved.

Definition at line 129 of file BonSubMipSolver.hpp.

int Bonmin::SubMipSolver::iterationCount_
private

number of simplex iteration in last mip solved.

Definition at line 131 of file BonSubMipSolver.hpp.

MILP_solve_strategy Bonmin::SubMipSolver::milp_strat_
private

MILP search strategy.

Definition at line 133 of file BonSubMipSolver.hpp.

double Bonmin::SubMipSolver::gap_tol_
private

setting for gap tolerance.

Definition at line 135 of file BonSubMipSolver.hpp.

bool Bonmin::SubMipSolver::ownClp_
private

say if owns copy of clp_.

Definition at line 137 of file BonSubMipSolver.hpp.


The documentation for this class was generated from the following files: