Cgl  0.59.10
Public Types | Friends | List of all members
CglGMI Class Reference

Gomory cut generator with several cleaning procedures, used to test the numerical safety of the resulting cuts. More...

#include <CglGMI.hpp>

+ Inheritance diagram for CglGMI:
+ Collaboration diagram for CglGMI:

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
 
CglGMIParamgetParam ()
 
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 &param)
 Constructor with specified parameters. More...
 
 CglGMI (const CglGMI &)
 Copy constructor. More...
 
virtual CglCutGeneratorclone () const
 Clone. More...
 
CglGMIoperator= (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...
 
- Public Member Functions inherited from CglCutGenerator
 CglCutGenerator ()
 Default constructor. More...
 
 CglCutGenerator (const CglCutGenerator &)
 Copy constructor. More...
 
CglCutGeneratoroperator= (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

- Public Attributes inherited from CglCutGenerator
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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ RejectionType

Public enum: all possible reasons for cut rejection.

Enumerator
failureFractionality 
failureDynamism 
failureViolation 
failureSupport 
failureScale 

Definition at line 44 of file CglGMI.hpp.

Constructor & Destructor Documentation

◆ CglGMI() [1/3]

CglGMI::CglGMI ( )

Default constructor.

◆ CglGMI() [2/3]

CglGMI::CglGMI ( const CglGMIParam param)

Constructor with specified parameters.

◆ CglGMI() [3/3]

CglGMI::CglGMI ( const CglGMI )

Copy constructor.

◆ ~CglGMI()

virtual CglGMI::~CglGMI ( )
virtual

Destructor.

Member Function Documentation

◆ generateCuts()

virtual void CglGMI::generateCuts ( const OsiSolverInterface &  si,
OsiCuts &  cs,
const CglTreeInfo  info = CglTreeInfo() 
)
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.

◆ needsOptimalBasis()

virtual bool CglGMI::needsOptimalBasis ( ) const
inlinevirtual

Return true if needs optimal basis to do cuts (will return true)

Reimplemented from CglCutGenerator.

Definition at line 77 of file CglGMI.hpp.

◆ areEqual()

bool CglGMI::areEqual ( double  x,
double  y,
double  epsAbs = 1e-12,
double  epsRel = 1e-12 
)
inline

Definition at line 83 of file CglGMI.hpp.

◆ isZero()

bool CglGMI::isZero ( double  x,
double  epsZero = 1e-20 
)
inline

Definition at line 91 of file CglGMI.hpp.

◆ isIntegerValue()

bool CglGMI::isIntegerValue ( double  x,
double  intEpsAbs = 1e-9,
double  intEpsRel = 1e-15 
)
inline

Definition at line 97 of file CglGMI.hpp.

◆ setParam()

void CglGMI::setParam ( const CglGMIParam source)

◆ getParam() [1/2]

CglGMIParam CglGMI::getParam ( ) const
inline

Definition at line 114 of file CglGMI.hpp.

◆ getParam() [2/2]

CglGMIParam& CglGMI::getParam ( )
inline

Definition at line 115 of file CglGMI.hpp.

◆ computeIsInteger()

void CglGMI::computeIsInteger ( )

◆ printOptTab()

void CglGMI::printOptTab ( OsiSolverInterface *  solver) const

Print the current simplex tableau.

◆ setTrackRejection()

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

◆ getTrackRejection()

bool CglGMI::getTrackRejection ( )

◆ getNumberRejectedCuts()

int CglGMI::getNumberRejectedCuts ( RejectionType  reason)

Get number of cuts rejected for given reason; see above.

◆ resetRejectionCounters()

void CglGMI::resetRejectionCounters ( )

Reset counters for cut rejection tracking; see above.

◆ getNumberGeneratedCuts()

int CglGMI::getNumberGeneratedCuts ( )

Get total number of generated cuts since last resetRejectionCounters()

◆ clone()

virtual CglCutGenerator* CglGMI::clone ( ) const
virtual

Clone.

Implements CglCutGenerator.

◆ operator=()

CglGMI& CglGMI::operator= ( const CglGMI rhs)

Assignment operator.

◆ generateCpp()

virtual std::string CglGMI::generateCpp ( FILE *  fp)
virtual

Create C++ lines to get to current state.

Reimplemented from CglCutGenerator.

Friends And Related Function Documentation

◆ CglGMIUnitTest

void CglGMIUnitTest ( const OsiSolverInterface *  siP,
const std::string  mpdDir 
)
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.


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