Cgl
0.59.9
|
Gomory cut generator with several cleaning procedures, used to test the numerical safety of the resulting cuts. More...
#include <CglGMI.hpp>
Public Types | |
enum | RejectionType { failureFractionality, failureDynamism, failureViolation, failureSupport, failureScale } |
Public enum: all possible reasons for cut rejection. More... | |
Public Member Functions | |
generateCuts | |
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) |
Generate Gomory Mixed-Integer cuts for the model of the solver interface si. More... | |
virtual bool | needsOptimalBasis () const |
Return true if needs optimal basis to do cuts (will return true) More... | |
Common Methods | |
bool | areEqual (double x, double y, double epsAbs=1e-12, double epsRel=1e-12) |
bool | isZero (double x, double epsZero=1e-20) |
bool | isIntegerValue (double x, double intEpsAbs=1e-9, double intEpsRel=1e-15) |
Public Methods | |
void | setParam (const CglGMIParam &source) |
CglGMIParam | getParam () const |
CglGMIParam & | getParam () |
void | computeIsInteger () |
void | printOptTab (OsiSolverInterface *solver) const |
Print the current simplex tableau. More... | |
void | setTrackRejection (bool value) |
Set/get tracking of the rejection of cutting planes. More... | |
bool | getTrackRejection () |
int | getNumberRejectedCuts (RejectionType reason) |
Get number of cuts rejected for given reason; see above. More... | |
void | resetRejectionCounters () |
Reset counters for cut rejection tracking; see above. More... | |
int | getNumberGeneratedCuts () |
Get total number of generated cuts since last resetRejectionCounters() More... | |
Constructors and destructors | |
CglGMI () | |
Default constructor. More... | |
CglGMI (const CglGMIParam ¶m) | |
Constructor with specified parameters. More... | |
CglGMI (const CglGMI &) | |
Copy constructor. More... | |
virtual CglCutGenerator * | clone () const |
Clone. More... | |
CglGMI & | operator= (const CglGMI &rhs) |
Assignment operator. More... | |
virtual | ~CglGMI () |
Destructor. More... | |
virtual std::string | generateCpp (FILE *fp) |
Create C++ lines to get to current state. More... | |
![]() | |
CglCutGenerator () | |
Default constructor. More... | |
CglCutGenerator (const CglCutGenerator &) | |
Copy constructor. More... | |
CglCutGenerator & | operator= (const CglCutGenerator &rhs) |
Assignment operator. More... | |
virtual | ~CglCutGenerator () |
Destructor. More... | |
virtual void | refreshSolver (OsiSolverInterface *) |
This can be used to refresh any information. More... | |
int | getAggressiveness () const |
Get Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
void | setAggressiveness (int value) |
Set Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
void | setGlobalCuts (bool trueOrFalse) |
Set whether can do global cuts. More... | |
bool | canDoGlobalCuts () const |
Say whether can do global cuts. More... | |
virtual bool | mayGenerateRowCutsInTree () const |
Returns true if may generate Row cuts in tree (rather than root node). More... | |
virtual int | maximumLengthOfCutInTree () const |
Return maximum length of cut in tree. More... | |
Friends | |
void | CglGMIUnitTest (const OsiSolverInterface *siP, const std::string mpdDir) |
A function that tests the methods in the CglGMI class. More... | |
Additional Inherited Members | |
![]() | |
int | aggressive_ |
Aggressiveness - 0 = neutral, 100 is normal root node. More... | |
bool | canDoGlobalCuts_ |
True if can do global cuts i.e. no general integers. More... | |
Gomory cut generator with several cleaning procedures, used to test the numerical safety of the resulting cuts.
Definition at line 37 of file CglGMI.hpp.
Public enum: all possible reasons for cut rejection.
Enumerator | |
---|---|
failureFractionality | |
failureDynamism | |
failureViolation | |
failureSupport | |
failureScale |
Definition at line 44 of file CglGMI.hpp.
CglGMI::CglGMI | ( | ) |
Default constructor.
CglGMI::CglGMI | ( | const CglGMIParam & | param | ) |
Constructor with specified parameters.
CglGMI::CglGMI | ( | const CglGMI & | ) |
Copy constructor.
|
virtual |
Destructor.
|
virtual |
Generate Gomory Mixed-Integer cuts for the model of the solver interface si.
Insert the generated cuts into OsiCuts cs.
Warning: This generator currently works only with the Lp solvers Clp or Cplex9.0 or higher. It requires access to the optimal tableau and optimal basis inverse and makes assumptions on the way slack variables are added by the solver. The Osi implementations for Clp and Cplex verify these assumptions.
When calling the generator, the solver interface si must contain an optimized problem and information related to the optimal basis must be available through the OsiSolverInterface methods (si->optimalBasisIsAvailable() must return 'true'). It is also essential that the integrality of structural variable i can be obtained using si->isInteger(i).
Implements CglCutGenerator.
|
inlinevirtual |
Return true if needs optimal basis to do cuts (will return true)
Reimplemented from CglCutGenerator.
Definition at line 77 of file CglGMI.hpp.
|
inline |
Definition at line 83 of file CglGMI.hpp.
|
inline |
Definition at line 91 of file CglGMI.hpp.
|
inline |
Definition at line 97 of file CglGMI.hpp.
void CglGMI::setParam | ( | const CglGMIParam & | source | ) |
|
inline |
Definition at line 114 of file CglGMI.hpp.
|
inline |
Definition at line 115 of file CglGMI.hpp.
void CglGMI::computeIsInteger | ( | ) |
void CglGMI::printOptTab | ( | OsiSolverInterface * | solver | ) | const |
Print the current simplex tableau.
void CglGMI::setTrackRejection | ( | bool | value | ) |
Set/get tracking of the rejection of cutting planes.
Note that all rejection related functions will not do anything unless the generator is compiled with the define GMI_TRACK_REJECTION
bool CglGMI::getTrackRejection | ( | ) |
int CglGMI::getNumberRejectedCuts | ( | RejectionType | reason | ) |
Get number of cuts rejected for given reason; see above.
void CglGMI::resetRejectionCounters | ( | ) |
Reset counters for cut rejection tracking; see above.
int CglGMI::getNumberGeneratedCuts | ( | ) |
Get total number of generated cuts since last resetRejectionCounters()
|
virtual |
Clone.
Implements CglCutGenerator.
|
virtual |
Create C++ lines to get to current state.
Reimplemented from CglCutGenerator.
|
friend |
A function that tests the methods in the CglGMI 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.