Gomory Cut Generator Class. More...
#include <CglGomory.hpp>
Public Member Functions | |
Generate Cuts | |
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) const |
Generate Mixed Integer Gomory cuts for the model of the solver interface, si. | |
int | generateCuts (const OsiRowCutDebugger *debugger, OsiCuts &cs, const CoinPackedMatrix &columnCopy, const CoinPackedMatrix &rowCopy, const double *objective, const double *colsol, const double *colLower, const double *colUpper, const double *rowLower, const double *rowUpper, const char *intVar, const CoinWarmStartBasis *warm, const CglTreeInfo info=CglTreeInfo()) const |
Generates cuts given matrix and solution etc, returns number of cuts generated. | |
int | generateCuts (const OsiRowCutDebugger *debugger, OsiCuts &cs, const CoinPackedMatrix &columnCopy, const double *objective, const double *colsol, const double *colLower, const double *colUpper, const double *rowLower, const double *rowUpper, const char *intVar, const CoinWarmStartBasis *warm, const CglTreeInfo info=CglTreeInfo()) const |
Generates cuts given matrix and solution etc, returns number of cuts generated (no row copy passed in). | |
virtual bool | needsOptimalBasis () const |
Return true if needs optimal basis to do cuts (will return true). | |
Change limit on how many variables in cut (default 50) | |
void | setLimit (int limit) |
Set. | |
int | getLimit () const |
Get. | |
void | setLimitAtRoot (int limit) |
Set at root (if <normal then use normal). | |
int | getLimitAtRoot () const |
Get at root. | |
Change criterion on which variables to look at. All ones | |
void | setAway (double value) |
Set. | |
double | getAway () const |
Get. | |
Constructors and destructors | |
CglGomory () | |
Default constructor. | |
CglGomory (const CglGomory &) | |
Copy constructor. | |
virtual CglCutGenerator * | clone () const |
Clone. | |
CglGomory & | operator= (const CglGomory &rhs) |
Assignment operator. | |
virtual | ~CglGomory () |
Destructor. | |
virtual std::string | generateCpp (FILE *fp) |
Create C++ lines to get to current state. | |
Private Attributes | |
Private member data | |
double | away_ |
Only investigate if more than this away from integrality. | |
int | limit_ |
Limit - only generate if fewer than this in cut. | |
int | limitAtRoot_ |
Limit - only generate if fewer than this in cut (at root). | |
Friends | |
void | CglGomoryUnitTest (const OsiSolverInterface *siP, const std::string mpdDir) |
A function that tests the methods in the CglGomory class. |
Gomory Cut Generator Class.
Definition at line 12 of file CglGomory.hpp.
CglGomory::CglGomory | ( | ) |
Default constructor.
CglGomory::CglGomory | ( | const CglGomory & | ) |
Copy constructor.
virtual CglGomory::~CglGomory | ( | ) | [virtual] |
Destructor.
virtual void CglGomory::generateCuts | ( | const OsiSolverInterface & | si, | |
OsiCuts & | cs, | |||
const CglTreeInfo | info = CglTreeInfo() | |||
) | const [virtual] |
Generate Mixed Integer Gomory cuts for the model of the solver interface, si.
Insert the generated cuts into OsiCut, cs.
There is a limit option, which will only generate cuts with less than this number of entries.
We can also only look at 0-1 variables a certain distance from integer.
Implements CglCutGenerator.
int CglGomory::generateCuts | ( | const OsiRowCutDebugger * | debugger, | |
OsiCuts & | cs, | |||
const CoinPackedMatrix & | columnCopy, | |||
const CoinPackedMatrix & | rowCopy, | |||
const double * | objective, | |||
const double * | colsol, | |||
const double * | colLower, | |||
const double * | colUpper, | |||
const double * | rowLower, | |||
const double * | rowUpper, | |||
const char * | intVar, | |||
const CoinWarmStartBasis * | warm, | |||
const CglTreeInfo | info = CglTreeInfo() | |||
) | const |
Generates cuts given matrix and solution etc, returns number of cuts generated.
int CglGomory::generateCuts | ( | const OsiRowCutDebugger * | debugger, | |
OsiCuts & | cs, | |||
const CoinPackedMatrix & | columnCopy, | |||
const double * | objective, | |||
const double * | colsol, | |||
const double * | colLower, | |||
const double * | colUpper, | |||
const double * | rowLower, | |||
const double * | rowUpper, | |||
const char * | intVar, | |||
const CoinWarmStartBasis * | warm, | |||
const CglTreeInfo | info = CglTreeInfo() | |||
) | const |
Generates cuts given matrix and solution etc, returns number of cuts generated (no row copy passed in).
virtual bool CglGomory::needsOptimalBasis | ( | ) | const [virtual] |
Return true if needs optimal basis to do cuts (will return true).
Reimplemented from CglCutGenerator.
void CglGomory::setLimit | ( | int | limit | ) |
Set.
int CglGomory::getLimit | ( | ) | const |
Get.
void CglGomory::setLimitAtRoot | ( | int | limit | ) |
Set at root (if <normal then use normal).
int CglGomory::getLimitAtRoot | ( | ) | const |
Get at root.
void CglGomory::setAway | ( | double | value | ) |
Set.
double CglGomory::getAway | ( | ) | const |
Get.
virtual CglCutGenerator* CglGomory::clone | ( | ) | const [virtual] |
Clone.
Implements CglCutGenerator.
Assignment operator.
Reimplemented from CglCutGenerator.
virtual std::string CglGomory::generateCpp | ( | FILE * | fp | ) | [virtual] |
Create C++ lines to get to current state.
Reimplemented from CglCutGenerator.
void CglGomoryUnitTest | ( | const OsiSolverInterface * | siP, | |
const std::string | mpdDir | |||
) | [friend] |
A function that tests the methods in the CglGomory 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.
double CglGomory::away_ [private] |
Only investigate if more than this away from integrality.
Definition at line 118 of file CglGomory.hpp.
int CglGomory::limit_ [private] |
Limit - only generate if fewer than this in cut.
Definition at line 120 of file CglGomory.hpp.
int CglGomory::limitAtRoot_ [private] |
Limit - only generate if fewer than this in cut (at root).
Definition at line 122 of file CglGomory.hpp.