Twostep MIR Cut Generator Class. More...
#include <CglTwomir.hpp>


Public Member Functions | |
Generate Cuts | |
| virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) |
| Generate Two step MIR cuts either from the tableau rows or from the formulation rows. | |
| virtual bool | needsOptimalBasis () const |
| Return true if needs optimal basis to do cuts (will return true). | |
Change criterion on which scalings to use (default = 1,1,1,1) | |
| void | setMirScale (int tmin, int tmax) |
| Set. | |
| void | setTwomirScale (int qmin, int qmax) |
| Set. | |
| void | setAMax (int a) |
| Set. | |
| void | setMaxElements (int n) |
| Set. | |
| void | setMaxElementsRoot (int n) |
| Set. | |
| void | setCutTypes (bool mir, bool twomir, bool tab, bool form) |
| Set. | |
| void | setFormulationRows (int n) |
| Set. | |
| int | getTmin () const |
| Get. | |
| int | getTmax () const |
| Set. | |
| int | getQmin () const |
| Set. | |
| int | getQmax () const |
| Set. | |
| int | getAmax () const |
| Set. | |
| int | getMaxElements () const |
| Set. | |
| int | getMaxElementsRoot () const |
| Set. | |
| int | getIfMir () const |
| Set. | |
| int | getIfTwomir () const |
| Set. | |
| int | getIfTableau () const |
| Set. | |
| int | getIfFormulation () const |
| Set. | |
Change criterion on which variables to look at. All ones | |
| void | setAway (double value) |
| Set away. | |
| double | getAway () const |
| Get away. | |
| void | setAwayAtRoot (double value) |
| Set away at root. | |
| double | getAwayAtRoot () const |
| Get away at root. | |
| virtual int | maximumLengthOfCutInTree () const |
| Return maximum length of cut in tree. | |
Change way TwoMir works | |
| void | passInOriginalSolver (OsiSolverInterface *solver) |
| Pass in a copy of original solver (clone it). | |
| OsiSolverInterface * | originalSolver () const |
| Returns original solver. | |
| void | setTwomirType (int type) |
| Set type - 0 normal, 1 add original matrix one, 2 replace. | |
| int | twomirType () const |
| Return type. | |
Constructors and destructors | |
| CglTwomir () | |
| Default constructor. | |
| CglTwomir (const CglTwomir &) | |
| Copy constructor. | |
| virtual CglCutGenerator * | clone () const |
| Clone. | |
| CglTwomir & | operator= (const CglTwomir &rhs) |
| Assignment operator. | |
| virtual | ~CglTwomir () |
| Destructor. | |
| virtual std::string | generateCpp (FILE *fp) |
| Create C++ lines to get to current state. | |
| virtual void | refreshSolver (OsiSolverInterface *solver) |
| This can be used to refresh any inforamtion. | |
Public Attributes | |
| std::string | probname_ |
| Problem name. | |
Private Attributes | |
Private member data | |
| CoinThreadRandom | randomNumberGenerator_ |
| Threadsafe random number generator. | |
| OsiSolverInterface * | originalSolver_ |
| Original solver. | |
| double | away_ |
| Only investigate if more than this away from integrality. | |
| double | awayAtRoot_ |
| Only investigate if more than this away from integrality (at root). | |
| int | twomirType_ |
| Type - 0 normal, 1 add original matrix one, 2 replace. | |
| bool | do_mir_ |
| Threadsafe random number generator. | |
| bool | do_2mir_ |
| Threadsafe random number generator. | |
| bool | do_tab_ |
| Threadsafe random number generator. | |
| bool | do_form_ |
| Threadsafe random number generator. | |
| int | t_min_ |
| Threadsafe random number generator. | |
| int | t_max_ |
| t_min - first value of t to use for tMIR inequalities | |
| int | q_min_ |
| t_max - last value of t to use for tMIR inequalities | |
| int | q_max_ |
| q_min - first value of t to use for 2-Step tMIR inequalities | |
| int | a_max_ |
| q_max - last value of t to use for 2-Step tMIR inequalities | |
| int | max_elements_ |
| a_max - maximum value of bhat/alpha | |
| int | max_elements_root_ |
| Maximum number of elements in cut. | |
| int | form_nrows_ |
| Maximum number of elements in cut at root. | |
Friends | |
| void | CglTwomirUnitTest (const OsiSolverInterface *siP, const std::string mpdDir) |
| A function that tests the methods in the CglTwomir class. | |
Twostep MIR Cut Generator Class.
Definition at line 91 of file CglTwomir.hpp.
| CglTwomir::CglTwomir | ( | ) |
Default constructor.
| CglTwomir::CglTwomir | ( | const CglTwomir & | ) |
Copy constructor.
| virtual CglTwomir::~CglTwomir | ( | ) | [virtual] |
Destructor.
| virtual void CglTwomir::generateCuts | ( | const OsiSolverInterface & | si, | |
| OsiCuts & | cs, | |||
| const CglTreeInfo | info = CglTreeInfo() | |||
| ) | [virtual] |
Generate Two step MIR cuts either from the tableau rows or from the formulation rows.
Implements CglCutGenerator.
| virtual bool CglTwomir::needsOptimalBasis | ( | ) | const [virtual] |
Return true if needs optimal basis to do cuts (will return true).
Reimplemented from CglCutGenerator.
| void CglTwomir::setMirScale | ( | int | tmin, | |
| int | tmax | |||
| ) | [inline] |
| void CglTwomir::setTwomirScale | ( | int | qmin, | |
| int | qmax | |||
| ) | [inline] |
| void CglTwomir::setAMax | ( | int | a | ) | [inline] |
| void CglTwomir::setMaxElements | ( | int | n | ) | [inline] |
| void CglTwomir::setMaxElementsRoot | ( | int | n | ) | [inline] |
| void CglTwomir::setCutTypes | ( | bool | mir, | |
| bool | twomir, | |||
| bool | tab, | |||
| bool | form | |||
| ) | [inline] |
| void CglTwomir::setFormulationRows | ( | int | n | ) | [inline] |
| int CglTwomir::getTmin | ( | ) | const [inline] |
| int CglTwomir::getTmax | ( | ) | const [inline] |
| int CglTwomir::getQmin | ( | ) | const [inline] |
| int CglTwomir::getQmax | ( | ) | const [inline] |
| int CglTwomir::getAmax | ( | ) | const [inline] |
| int CglTwomir::getMaxElements | ( | ) | const [inline] |
| int CglTwomir::getMaxElementsRoot | ( | ) | const [inline] |
| int CglTwomir::getIfMir | ( | ) | const [inline] |
| int CglTwomir::getIfTwomir | ( | ) | const [inline] |
| int CglTwomir::getIfTableau | ( | ) | const [inline] |
| int CglTwomir::getIfFormulation | ( | ) | const [inline] |
| void CglTwomir::setAway | ( | double | value | ) |
Set away.
| double CglTwomir::getAway | ( | ) | const |
Get away.
| void CglTwomir::setAwayAtRoot | ( | double | value | ) |
Set away at root.
| double CglTwomir::getAwayAtRoot | ( | ) | const |
Get away at root.
| virtual int CglTwomir::maximumLengthOfCutInTree | ( | ) | const [inline, virtual] |
Return maximum length of cut in tree.
Reimplemented from CglCutGenerator.
Definition at line 151 of file CglTwomir.hpp.
References max_elements_.
| void CglTwomir::passInOriginalSolver | ( | OsiSolverInterface * | solver | ) |
Pass in a copy of original solver (clone it).
| OsiSolverInterface* CglTwomir::originalSolver | ( | ) | const [inline] |
| void CglTwomir::setTwomirType | ( | int | type | ) | [inline] |
Set type - 0 normal, 1 add original matrix one, 2 replace.
Definition at line 163 of file CglTwomir.hpp.
References twomirType_.
| int CglTwomir::twomirType | ( | ) | const [inline] |
| virtual CglCutGenerator* CglTwomir::clone | ( | ) | const [virtual] |
Clone.
Implements CglCutGenerator.
Assignment operator.
Reimplemented from CglCutGenerator.
| virtual std::string CglTwomir::generateCpp | ( | FILE * | fp | ) | [virtual] |
Create C++ lines to get to current state.
Reimplemented from CglCutGenerator.
| virtual void CglTwomir::refreshSolver | ( | OsiSolverInterface * | solver | ) | [virtual] |
This can be used to refresh any inforamtion.
Reimplemented from CglCutGenerator.
| void CglTwomirUnitTest | ( | const OsiSolverInterface * | siP, | |
| const std::string | mpdDir | |||
| ) | [friend] |
A function that tests the methods in the CglTwomir class.
The only reason for it not to be a member method is that this way it doesn't have to be compiled into the library. And that's a gain, because the library should be compiled with optimization on, but this method should be compiled with debugging.
| std::string CglTwomir::probname_ |
Problem name.
Definition at line 100 of file CglTwomir.hpp.
Threadsafe random number generator.
Definition at line 197 of file CglTwomir.hpp.
OsiSolverInterface* CglTwomir::originalSolver_ [private] |
double CglTwomir::away_ [private] |
Only investigate if more than this away from integrality.
Definition at line 201 of file CglTwomir.hpp.
double CglTwomir::awayAtRoot_ [private] |
Only investigate if more than this away from integrality (at root).
Definition at line 203 of file CglTwomir.hpp.
int CglTwomir::twomirType_ [private] |
Type - 0 normal, 1 add original matrix one, 2 replace.
Definition at line 205 of file CglTwomir.hpp.
Referenced by setTwomirType(), and twomirType().
bool CglTwomir::do_mir_ [private] |
Threadsafe random number generator.
Definition at line 206 of file CglTwomir.hpp.
Referenced by getIfMir(), and setCutTypes().
bool CglTwomir::do_2mir_ [private] |
Threadsafe random number generator.
Definition at line 207 of file CglTwomir.hpp.
Referenced by getIfTwomir(), and setCutTypes().
bool CglTwomir::do_tab_ [private] |
Threadsafe random number generator.
Definition at line 208 of file CglTwomir.hpp.
Referenced by getIfTableau(), and setCutTypes().
bool CglTwomir::do_form_ [private] |
Threadsafe random number generator.
Definition at line 209 of file CglTwomir.hpp.
Referenced by getIfFormulation(), and setCutTypes().
int CglTwomir::t_min_ [private] |
Threadsafe random number generator.
Definition at line 211 of file CglTwomir.hpp.
Referenced by getTmin(), and setMirScale().
int CglTwomir::t_max_ [private] |
t_min - first value of t to use for tMIR inequalities
Definition at line 212 of file CglTwomir.hpp.
Referenced by getTmax(), and setMirScale().
int CglTwomir::q_min_ [private] |
t_max - last value of t to use for tMIR inequalities
Definition at line 213 of file CglTwomir.hpp.
Referenced by getQmin(), and setTwomirScale().
int CglTwomir::q_max_ [private] |
q_min - first value of t to use for 2-Step tMIR inequalities
Definition at line 214 of file CglTwomir.hpp.
Referenced by getQmax(), and setTwomirScale().
int CglTwomir::a_max_ [private] |
q_max - last value of t to use for 2-Step tMIR inequalities
Definition at line 215 of file CglTwomir.hpp.
int CglTwomir::max_elements_ [private] |
a_max - maximum value of bhat/alpha
Definition at line 216 of file CglTwomir.hpp.
Referenced by getMaxElements(), maximumLengthOfCutInTree(), and setMaxElements().
int CglTwomir::max_elements_root_ [private] |
Maximum number of elements in cut.
Definition at line 217 of file CglTwomir.hpp.
Referenced by getMaxElementsRoot(), and setMaxElementsRoot().
int CglTwomir::form_nrows_ [private] |
Maximum number of elements in cut at root.
Definition at line 218 of file CglTwomir.hpp.
Referenced by setFormulationRows().
1.6.1