Bonmin  1.7
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
Bonmin::SubMipSolver Class Reference

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

#include <BonSubMipSolver.hpp>

List of all members.

Public Types

enum  MILP_solve_strategy { FindGoodSolution, GetOptimum }

Public Member Functions

 SubMipSolver (BabSetupBase &b, const std::string &prefix)
 Constructor.
 SubMipSolver (const SubMipSolver &copy)
 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.
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.
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 for that Oa based cut generation method.

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

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.

Bonmin::SubMipSolver::SubMipSolver ( const SubMipSolver copy)

Copy Constructor.

Bonmin::SubMipSolver::~SubMipSolver ( )

Member Function Documentation

void Bonmin::SubMipSolver::setLpSolver ( OsiSolverInterface *  lp)

Assign lp solver.

void Bonmin::SubMipSolver::setStrategy ( CbcStrategyDefault *  strategy)

Assign a strategy.

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.

References integerSolution_.

double Bonmin::SubMipSolver::getLowerBound ( ) [inline]

Definition at line 55 of file BonSubMipSolver.hpp.

References lowBound_.

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

Definition at line 60 of file BonSubMipSolver.hpp.

References find_good_sol(), FindGoodSolution, milp_strat_, and optimize().

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

update cutoff and perform a local search to a good solution.

Referenced by solve().

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

update cutoff and optimize MIP.

Referenced by solve().

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.

double Bonmin::SubMipSolver::lowBound ( ) [inline]

Returns lower bound.

Definition at line 87 of file BonSubMipSolver.hpp.

References lowBound_.

bool Bonmin::SubMipSolver::optimal ( ) [inline]

returns optimality status.

Definition at line 93 of file BonSubMipSolver.hpp.

References optimal_.

int Bonmin::SubMipSolver::nodeCount ( ) [inline]

Returns number of nodes in last solve.

Definition at line 99 of file BonSubMipSolver.hpp.

References nodeCount_.

int Bonmin::SubMipSolver::iterationCount ( ) [inline]

Returns number of simplex iterations in last solve.

Definition at line 105 of file BonSubMipSolver.hpp.

References iterationCount_.

OsiSolverInterface* Bonmin::SubMipSolver::solver ( )
static void Bonmin::SubMipSolver::registerOptions ( Ipopt::SmartPtr< Bonmin::RegisteredOptions roptions) [static]

Register options for that Oa based cut generation method.


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.

lower bound obtained

Definition at line 121 of file BonSubMipSolver.hpp.

Referenced by getLowerBound(), and lowBound().

Is optimality proven?

Definition at line 123 of file BonSubMipSolver.hpp.

Referenced by optimal().

Has an integer solution? then it is here.

Definition at line 125 of file BonSubMipSolver.hpp.

Referenced by getLastSolution().

CbcStrategyDefault* Bonmin::SubMipSolver::strategy_ [private]

Strategy for solving sub mips with cbc.

Definition at line 127 of file BonSubMipSolver.hpp.

number of nodes in last mip solved.

Definition at line 129 of file BonSubMipSolver.hpp.

Referenced by nodeCount().

number of simplex iteration in last mip solved.

Definition at line 131 of file BonSubMipSolver.hpp.

Referenced by iterationCount().

MILP search strategy.

Definition at line 133 of file BonSubMipSolver.hpp.

Referenced by solve().

setting for gap tolerance.

Definition at line 135 of file BonSubMipSolver.hpp.

say if owns copy of clp_.

Definition at line 137 of file BonSubMipSolver.hpp.


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