coin-Cgl
Friends | List of all members
CglGomory Class Reference

Gomory Cut Generator Class. More...

#include <CglGomory.hpp>

Inheritance diagram for CglGomory:
Inheritance graph
[legend]
Collaboration diagram for CglGomory:
Collaboration graph
[legend]

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. More...
 
int generateCuts (const OsiRowCutDebugger *debugger, OsiCuts &cs, const CoinPackedMatrix &columnCopy, const CoinPackedMatrix &rowCopy, 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. More...
 
int generateCuts (const OsiRowCutDebugger *debugger, OsiCuts &cs, const CoinPackedMatrix &columnCopy, 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) More...
 
virtual bool needsOptimalBasis () const
 Return true if needs optimal basis to do cuts (will return true) More...
 
Change limit on how many variables in cut (default 50)
void setLimit (int limit)
 Set. More...
 
int getLimit () const
 Get. More...
 
void setLimitAtRoot (int limit)
 Set at root (if <normal then use normal) More...
 
int getLimitAtRoot () const
 Get at root. More...
 
virtual int maximumLengthOfCutInTree () const
 Return maximum length of cut in tree. More...
 
Change criterion on which variables to look at. All ones

more than "away" away from integrality will be investigated (default 0.05)

void setAway (double value)
 Set away. More...
 
double getAway () const
 Get away. More...
 
void setAwayAtRoot (double value)
 Set away at root. More...
 
double getAwayAtRoot () const
 Get away at root. More...
 
Change criterion on which the cut id relaxed if the code

thinks the factorization has inaccuracies.

The relaxation to RHS is smallest of - 1) 1.0e-4 2) conditionNumberMultiplier * condition number of factorization 3) largestFactorMultiplier * largest (dual*element) forming tableau row

void setConditionNumberMultiplier (double value)
 Set ConditionNumberMultiplier. More...
 
double getConditionNumberMultiplier () const
 Get ConditionNumberMultiplier. More...
 
void setLargestFactorMultiplier (double value)
 Set LargestFactorMultiplier. More...
 
double getLargestFactorMultiplier () const
 Get LargestFactorMultiplier. More...
 
change factorization
void useAlternativeFactorization (bool yes=true)
 Set/unset alternative factorization. More...
 
bool alternativeFactorization () const
 Get whether alternative factorization being used. More...
 
Constructors and destructors
 CglGomory ()
 Default constructor. More...
 
 CglGomory (const CglGomory &)
 Copy constructor. More...
 
virtual CglCutGeneratorclone () const
 Clone. More...
 
CglGomoryoperator= (const CglGomory &rhs)
 Assignment operator. More...
 
virtual ~CglGomory ()
 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...
 
virtual bool mayGenerateRowCutsInTree () const
 Returns true if may generate Row cuts in tree (rather than root node). More...
 

Private Attributes

Private member data
double away_
 Only investigate if more than this away from integrality. More...
 
double awayAtRoot_
 Only investigate if more than this away from integrality (at root) More...
 
double conditionNumberMultiplier_
 Multiplier for conditionNumber cut relaxation. More...
 
double largestFactorMultiplier_
 Multiplier for largest factor cut relaxation. More...
 
int limit_
 Limit - only generate if fewer than this in cut. More...
 
int limitAtRoot_
 Limit - only generate if fewer than this in cut (at root) More...
 
int dynamicLimitInTree_
 Dynamic limit in tree. More...
 
int numberTimesStalled_
 Number of times stalled. More...
 
int alternateFactorization_
 nonzero to use alternative factorization More...
 

Friends

void CglGomoryUnitTest (const OsiSolverInterface *siP, const std::string mpdDir)
 A function that tests the methods in the CglGomory class. More...
 

Additional Inherited Members

- Public Attributes inherited from CglCutGenerator
int aggressive_
 Aggressiveness - 0 = neutral, 100 is normal root node. More...
 

Detailed Description

Gomory Cut Generator Class.

Definition at line 12 of file CglGomory.hpp.

Constructor & Destructor Documentation

CglGomory::CglGomory ( )

Default constructor.

CglGomory::CglGomory ( const CglGomory )

Copy constructor.

virtual CglGomory::~CglGomory ( )
virtual

Destructor.

Member Function Documentation

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

virtual int CglGomory::maximumLengthOfCutInTree ( ) const
virtual

Return maximum length of cut in tree.

Reimplemented from CglCutGenerator.

void CglGomory::setAway ( double  value)

Set away.

double CglGomory::getAway ( ) const

Get away.

void CglGomory::setAwayAtRoot ( double  value)

Set away at root.

double CglGomory::getAwayAtRoot ( ) const

Get away at root.

void CglGomory::setConditionNumberMultiplier ( double  value)

Set ConditionNumberMultiplier.

double CglGomory::getConditionNumberMultiplier ( ) const

Get ConditionNumberMultiplier.

void CglGomory::setLargestFactorMultiplier ( double  value)

Set LargestFactorMultiplier.

double CglGomory::getLargestFactorMultiplier ( ) const

Get LargestFactorMultiplier.

void CglGomory::useAlternativeFactorization ( bool  yes = true)
inline

Set/unset alternative factorization.

Definition at line 112 of file CglGomory.hpp.

bool CglGomory::alternativeFactorization ( ) const
inline

Get whether alternative factorization being used.

Definition at line 115 of file CglGomory.hpp.

References alternateFactorization_.

virtual CglCutGenerator* CglGomory::clone ( ) const
virtual

Clone.

Implements CglCutGenerator.

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

Assignment operator.

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

Create C++ lines to get to current state.

Reimplemented from CglCutGenerator.

Friends And Related Function Documentation

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.

Member Data Documentation

double CglGomory::away_
private

Only investigate if more than this away from integrality.

Definition at line 152 of file CglGomory.hpp.

double CglGomory::awayAtRoot_
private

Only investigate if more than this away from integrality (at root)

Definition at line 154 of file CglGomory.hpp.

double CglGomory::conditionNumberMultiplier_
private

Multiplier for conditionNumber cut relaxation.

Definition at line 156 of file CglGomory.hpp.

double CglGomory::largestFactorMultiplier_
private

Multiplier for largest factor cut relaxation.

Definition at line 158 of file CglGomory.hpp.

int CglGomory::limit_
private

Limit - only generate if fewer than this in cut.

Definition at line 160 of file CglGomory.hpp.

int CglGomory::limitAtRoot_
private

Limit - only generate if fewer than this in cut (at root)

Definition at line 162 of file CglGomory.hpp.

int CglGomory::dynamicLimitInTree_
mutableprivate

Dynamic limit in tree.

Definition at line 164 of file CglGomory.hpp.

int CglGomory::numberTimesStalled_
mutableprivate

Number of times stalled.

Definition at line 166 of file CglGomory.hpp.

int CglGomory::alternateFactorization_
private

nonzero to use alternative factorization

Definition at line 168 of file CglGomory.hpp.

Referenced by alternativeFactorization().


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