Loading...
Searching...
No Matches
CglGomory Class Reference

Gomory Cut Generator Class. More...

`#include <CglGomory.hpp>`

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

## Public Member Functions

Generate Cuts
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
| 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 *colsol, const double *colLower, const double *colUpper, const double *rowLower, const double *rowUpper, const char *intVar, const CoinWarmStartBasis *warm, const CglTreeInfo info=CglTreeInfo())
| Generates cuts given matrix and solution etc, returns number of cuts generated.
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())
| 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 way Gomory works
void | passInOriginalSolver (OsiSolverInterface *solver)
| Pass in a copy of original solver (clone it).
OsiSolverInterface * | originalSolver () const
| Returns original solver.
void | setGomoryType (int type)
| Set type - 0 normal, 1 add original matrix one, 2 replace.
int | gomoryType () const
| Return type.
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.
virtual int | maximumLengthOfCutInTree () const
| Return maximum length of cut in tree.
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.
double | getAway () const
| Get away.
void | setAwayAtRoot (double value)
| Set away at root.
double | getAwayAtRoot () const
| Get away at root.
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.
double | getConditionNumberMultiplier () const
| Get ConditionNumberMultiplier.
void | setLargestFactorMultiplier (double value)
| Set LargestFactorMultiplier.
double | getLargestFactorMultiplier () const
| Get LargestFactorMultiplier.
change factorization
void | useAlternativeFactorization (bool yes=true)
| Set/unset alternative factorization.
bool | alternativeFactorization () const
| Get whether alternative factorization being used.
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.
virtual void | refreshSolver (OsiSolverInterface *solver)
| This can be used to refresh any inforamtion.
Public Member Functions inherited from CglCutGenerator
| CglCutGenerator ()
| Default constructor.
| CglCutGenerator (const CglCutGenerator &)
| Copy constructor.
CglCutGenerator & | operator= (const CglCutGenerator &rhs)
| Assignment operator.
virtual | ~CglCutGenerator ()
| Destructor.
int | getAggressiveness () const
| Get Aggressiveness - 0 = neutral, 100 is normal root node.
void | setAggressiveness (int value)
| Set Aggressiveness - 0 = neutral, 100 is normal root node.
void | setGlobalCuts (bool trueOrFalse)
| Set whether can do global cuts.
bool | canDoGlobalCuts () const
| Say whether can do global cuts.
virtual bool | mayGenerateRowCutsInTree () const
| Returns true if may generate Row cuts in tree (rather than root node).

## Private Attributes

Private member data
double | away_
| Only investigate if more than this away from integrality.
double | awayAtRoot_
| Only investigate if more than this away from integrality (at root).
double | conditionNumberMultiplier_
| Multiplier for conditionNumber cut relaxation.
double | largestFactorMultiplier_
| Multiplier for largest factor cut relaxation.
OsiSolverInterface * | originalSolver_
| Original solver.
int | limit_
| Limit - only generate if fewer than this in cut.
int | limitAtRoot_
| Limit - only generate if fewer than this in cut (at root).
int | dynamicLimitInTree_
| Dynamic limit in tree.
int | numberTimesStalled_
| Number of times stalled.
int | alternateFactorization_
| nonzero to use alternative factorization
int | gomoryType_
| Type - 0 normal, 1 add original matrix one, 2 replace.

## Friends

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

## Additional Inherited Members

int | aggressive_
| Aggressiveness - 0 = neutral, 100 is normal root node.
bool | canDoGlobalCuts_
| True if can do global cuts i.e. no general integers.

## Detailed Description

Gomory Cut Generator Class.

Definition at line 14 of file CglGomory.hpp.

## Constructor & Destructor Documentation

## CglGomory() [1/2]

CglGomory::CglGomory | ( |  | ) |

Default constructor.

## CglGomory() [2/2]

CglGomory::CglGomory | ( | const CglGomory & |  | ) |

Copy constructor.

## ~CglGomory()

virtual CglGomory::~CglGomory | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## generateCuts() [1/3]

virtual void CglGomory::generateCuts | ( | const OsiSolverInterface & | si,
|  | OsiCuts & | cs,
|  | const CglTreeInfo | info = CglTreeInfo() )

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.

## generateCuts() [2/3]

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() )

Generates cuts given matrix and solution etc, returns number of cuts generated.

## generateCuts() [3/3]

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() )

Generates cuts given matrix and solution etc, returns number of cuts generated (no row copy passed in).

## needsOptimalBasis()

virtual bool CglGomory::needsOptimalBasis | ( |  | ) | const

inline virtual

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

Reimplemented from CglCutGenerator.

Definition at line 61 of file CglGomory.hpp.

## passInOriginalSolver()

void CglGomory::passInOriginalSolver | ( | OsiSolverInterface * | solver | ) |

Pass in a copy of original solver (clone it).

## originalSolver()

OsiSolverInterface * CglGomory::originalSolver | ( |  | ) | const

inline

Returns original solver.

Definition at line 69 of file CglGomory.hpp.

## setGomoryType()

void CglGomory::setGomoryType | ( | int | type | ) |

inline

Set type - 0 normal, 1 add original matrix one, 2 replace.

Definition at line 72 of file CglGomory.hpp.

## gomoryType()

int CglGomory::gomoryType | ( |  | ) | const

inline

Return type.

Definition at line 75 of file CglGomory.hpp.

## setLimit()

void CglGomory::setLimit | ( | int | limit | ) |

Set.

## getLimit()

int CglGomory::getLimit | ( |  | ) | const

Get.

## setLimitAtRoot()

void CglGomory::setLimitAtRoot | ( | int | limit | ) |

Set at root (if <normal then use normal).

## getLimitAtRoot()

int CglGomory::getLimitAtRoot | ( |  | ) | const

Get at root.

## maximumLengthOfCutInTree()

virtual int CglGomory::maximumLengthOfCutInTree | ( |  | ) | const

virtual

Return maximum length of cut in tree.

Reimplemented from CglCutGenerator.

## setAway()

void CglGomory::setAway | ( | double | value | ) |

Set away.

## getAway()

double CglGomory::getAway | ( |  | ) | const

Get away.

## setAwayAtRoot()

void CglGomory::setAwayAtRoot | ( | double | value | ) |

Set away at root.

## getAwayAtRoot()

double CglGomory::getAwayAtRoot | ( |  | ) | const

Get away at root.

## setConditionNumberMultiplier()

void CglGomory::setConditionNumberMultiplier | ( | double | value | ) |

Set ConditionNumberMultiplier.

## getConditionNumberMultiplier()

double CglGomory::getConditionNumberMultiplier | ( |  | ) | const

Get ConditionNumberMultiplier.

## setLargestFactorMultiplier()

void CglGomory::setLargestFactorMultiplier | ( | double | value | ) |

Set LargestFactorMultiplier.

## getLargestFactorMultiplier()

double CglGomory::getLargestFactorMultiplier | ( |  | ) | const

Get LargestFactorMultiplier.

## useAlternativeFactorization()

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

inline

Set/unset alternative factorization.

Definition at line 129 of file CglGomory.hpp.

## alternativeFactorization()

bool CglGomory::alternativeFactorization | ( |  | ) | const

inline

Get whether alternative factorization being used.

Definition at line 132 of file CglGomory.hpp.

## clone()

virtual CglCutGenerator * CglGomory::clone | ( |  | ) | const

virtual

Clone.

Implements CglCutGenerator.

## operator=()

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

Assignment operator.

## generateCpp()

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

virtual

Create C++ lines to get to current state.

Reimplemented from CglCutGenerator.

## refreshSolver()

virtual void CglGomory::refreshSolver | ( | OsiSolverInterface * | solver | ) |

virtual

This can be used to refresh any inforamtion.

Reimplemented from CglCutGenerator.

## Friends And Related Symbol Documentation

## CglGomoryUnitTest

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

## away_

double CglGomory::away_

private

Only investigate if more than this away from integrality.

Definition at line 171 of file CglGomory.hpp.

## awayAtRoot_

double CglGomory::awayAtRoot_

private

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

Definition at line 173 of file CglGomory.hpp.

## conditionNumberMultiplier_

double CglGomory::conditionNumberMultiplier_

private

Multiplier for conditionNumber cut relaxation.

Definition at line 175 of file CglGomory.hpp.

## largestFactorMultiplier_

double CglGomory::largestFactorMultiplier_

private

Multiplier for largest factor cut relaxation.

Definition at line 177 of file CglGomory.hpp.

## originalSolver_

OsiSolverInterface* CglGomory::originalSolver_

private

Original solver.

Definition at line 179 of file CglGomory.hpp.

## limit_

int CglGomory::limit_

private

Limit - only generate if fewer than this in cut.

Definition at line 181 of file CglGomory.hpp.

## limitAtRoot_

int CglGomory::limitAtRoot_

private

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

Definition at line 183 of file CglGomory.hpp.

## dynamicLimitInTree_

int CglGomory::dynamicLimitInTree_

private

Dynamic limit in tree.

Definition at line 185 of file CglGomory.hpp.

## numberTimesStalled_

int CglGomory::numberTimesStalled_

private

Number of times stalled.

Definition at line 187 of file CglGomory.hpp.

## alternateFactorization_

int CglGomory::alternateFactorization_

private

nonzero to use alternative factorization

Definition at line 189 of file CglGomory.hpp.

## gomoryType_

int CglGomory::gomoryType_

private

Type - 0 normal, 1 add original matrix one, 2 replace.

Definition at line 191 of file CglGomory.hpp.

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

- Cgl/src/CglGomory/CglGomory.hpp