Loading...
Searching...
No Matches
CglFlowCover Class Reference

Lifed Simple Generalized Flow Cover Cut Generator Class. More...

`#include <CglFlowCover.hpp>`

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

## Public Member Functions

void | flowPreprocess (const OsiSolverInterface &si)
| Do the following tasks:
Generate Cuts
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
| Generate Lifed Simple Generalized flow cover cuts for the model data contained in si.
Functions to query and set maximum number of cuts can be
generated.
int | getMaxNumCuts () const
void | setMaxNumCuts (int mc)
Functions to query and set the number of cuts have been
generated.
int | getNumFlowCuts ()
void | setNumFlowCuts (int fc)
void | incNumFlowCuts (int fc=1)
Public Member Functions inherited from CglCutGenerator
| CglCutGenerator ()
| Default constructor.
| CglCutGenerator (const CglCutGenerator &)
| Copy constructor.
CglCutGenerator & | operator= (const CglCutGenerator &rhs)
| Assignment operator.
virtual | ~CglCutGenerator ()
| Destructor.
virtual void | refreshSolver (OsiSolverInterface *)
| This can be used to refresh any information.
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).
virtual bool | needsOptimalBasis () const
| Return true if needs optimal basis to do cuts.
virtual int | maximumLengthOfCutInTree () const
| Return maximum length of cut in tree.

## Friends

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

## Constructors and destructors

int | maxNumCuts_
| The maximum number of flow cuts to be generated.
double | EPSILON_
| Tolerance used for numerical purpose.
int | UNDEFINED_
| The variable upper bound of a flow is not indentified yet.
double | INFTY_
| Very large number.
double | TOLERANCE_
| If violation of a cut is greater that this number, the cut is useful.
bool | firstProcess_
| First time preprocessing.
int | numRows_
| The number rows of the problem.
int | numCols_
| The number columns of the problem.
int | numFlowCuts_
| The number flow cuts found.
bool | doneInitPre_
| Indicate whether initial flow preprecessing has been done.
CglFlowVUB * | vubs_
| The array of CglFlowVUBs.
CglFlowVLB * | vlbs_
| The array of CglFlowVLBs.
CglFlowRowType * | rowTypes_
| CglFlowRowType of the rows in model.
| CglFlowCover ()
| Default constructor.
| CglFlowCover (const CglFlowCover &)
| Copy constructor.
virtual CglCutGenerator * | clone () const
| Clone.
CglFlowCover & | operator= (const CglFlowCover &rhs)
| Assignment operator.
virtual | ~CglFlowCover ()
| Destructor.
virtual std::string | generateCpp (FILE *fp)
| Create C++ lines to get to current state.
bool | generateOneFlowCut (const OsiSolverInterface &si, const int rowLen, int *ind, double *coef, char sense, double rhs, OsiRowCut &flowCut, double &violation)
| Based a given row, a LP solution and other model data, this function tries to generate a violated lifted simple generalized flow cover.
void | flipRow (int rowLen, double *coef, double &rhs) const
| Transform a row from ">=" to "<=", and vice versa.
void | flipRow (int rowLen, double *coef, char &sen, double &rhs) const
| Transform a row from ">=" to "<=", and vice versa.
CglFlowRowType | determineOneRowType (const OsiSolverInterface &si, int rowLen, int *ind, double *coef, char sen, double rhs) const
| Determine the type of a given row.
void | liftMinus (double &movement, int t, int r, double z, double dPrimePrime, double lambda, double ml, double *M, double *rho) const
| Lift functions.
bool | liftPlus (double &alpha, double &beta, int r, double m_j, double lambda, double y_j, double x_j, double dPrimePrime, double *M) const
const CglFlowRowType * | getRowTypes () const
CglFlowRowType | getRowType (const int i) const
void | setRowTypes (CglFlowRowType *rt)
| Set rowtypes, take over the ownership.
void | setRowTypes (const CglFlowRowType rt, const int i)
const CglFlowVUB * | getVubs () const
const CglFlowVUB & | getVubs (int i) const
void | setVubs (CglFlowVUB *vubs)
| Set CglFlowVUBs,take over the ownership.
void | setVubs (const CglFlowVUB &vub, int i)
void | printVubs (std::ostream &os) const
const CglFlowVLB * | getVlbs () const
const CglFlowVLB & | getVlbs (int i) const
void | setVlbs (CglFlowVLB *vlbs)
| Set CglFlowVLBs,take over the ownership.
void | setVlbs (const CglFlowVLB &vlb, int i)

## 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

Lifed Simple Generalized Flow Cover Cut Generator Class.

Definition at line 148 of file CglFlowCover.hpp.

## Constructor & Destructor Documentation

## CglFlowCover() [1/2]

CglFlowCover::CglFlowCover | ( |  | ) |

Default constructor.

## CglFlowCover() [2/2]

CglFlowCover::CglFlowCover | ( | const CglFlowCover & |  | ) |

Copy constructor.

## ~CglFlowCover()

virtual CglFlowCover::~CglFlowCover | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## flowPreprocess()

void CglFlowCover::flowPreprocess | ( | const OsiSolverInterface & | si | ) |

Do the following tasks:

- classify row types
- indentify vubs and vlbs

This function is called by `generateCuts(const OsiSolverInterface & si, OsiCuts & cs)`.

## generateCuts()

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

virtual

Generate Lifed Simple Generalized flow cover cuts for the model data contained in si.

The generated cuts are inserted into and returned in the collection of cuts cs.

Implements CglCutGenerator.

## getMaxNumCuts()

int CglFlowCover::getMaxNumCuts | ( |  | ) | const

inline

Definition at line 178 of file CglFlowCover.hpp.

## setMaxNumCuts()

void CglFlowCover::setMaxNumCuts | ( | int | mc | ) |

inline

Definition at line 179 of file CglFlowCover.hpp.

## getNumFlowCuts()

int CglFlowCover::getNumFlowCuts | ( |  | ) |

inline

Definition at line 185 of file CglFlowCover.hpp.

## setNumFlowCuts()

void CglFlowCover::setNumFlowCuts | ( | int | fc | ) |

inline

Definition at line 186 of file CglFlowCover.hpp.

## incNumFlowCuts()

void CglFlowCover::incNumFlowCuts | ( | int | fc = 1 | ) |

inline

Definition at line 187 of file CglFlowCover.hpp.

## clone()

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

virtual

Clone.

Implements CglCutGenerator.

## operator=()

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

Assignment operator.

## generateCpp()

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

virtual

Create C++ lines to get to current state.

Reimplemented from CglCutGenerator.

## generateOneFlowCut()

bool CglFlowCover::generateOneFlowCut | ( | const OsiSolverInterface & | si,
|  | const int | rowLen,
|  | int * | ind,
|  | double * | coef,
|  | char | sense,
|  | double | rhs,
|  | OsiRowCut & | flowCut,
|  | double & | violation )

private

Based a given row, a LP solution and other model data, this function tries to generate a violated lifted simple generalized flow cover.

## flipRow() [1/2]

void CglFlowCover::flipRow | ( | int | rowLen,
|  | double * | coef,
|  | double & | rhs ) const

private

Transform a row from ">=" to "<=", and vice versa.

## flipRow() [2/2]

void CglFlowCover::flipRow | ( | int | rowLen,
|  | double * | coef,
|  | char & | sen,
|  | double & | rhs ) const

private

Transform a row from ">=" to "<=", and vice versa.

Have 'sense'.

## determineOneRowType()

CglFlowRowType CglFlowCover::determineOneRowType | ( | const OsiSolverInterface & | si,
|  | int | rowLen,
|  | int * | ind,
|  | double * | coef,
|  | char | sen,
|  | double | rhs ) const

private

Determine the type of a given row.

## liftMinus()

void CglFlowCover::liftMinus | ( | double & | movement,
|  | int | t,
|  | int | r,
|  | double | z,
|  | double | dPrimePrime,
|  | double | lambda,
|  | double | ml,
|  | double * | M,
|  | double * | rho ) const

private

Lift functions.

## liftPlus()

bool CglFlowCover::liftPlus | ( | double & | alpha,
|  | double & | beta,
|  | int | r,
|  | double | m_j,
|  | double | lambda,
|  | double | y_j,
|  | double | x_j,
|  | double | dPrimePrime,
|  | double * | M ) const

private

## getRowTypes()

const CglFlowRowType * CglFlowCover::getRowTypes | ( |  | ) | const

inline private

Definition at line 268 of file CglFlowCover.hpp.

## getRowType()

CglFlowRowType CglFlowCover::getRowType | ( | const int | i | ) | const

inline private

Definition at line 270 of file CglFlowCover.hpp.

## setRowTypes() [1/2]

void CglFlowCover::setRowTypes | ( | CglFlowRowType * | rt | ) |

inline private

Set rowtypes, take over the ownership.

Definition at line 273 of file CglFlowCover.hpp.

## setRowTypes() [2/2]

void CglFlowCover::setRowTypes | ( | const CglFlowRowType | rt,
|  | const int | i )

inline private

Definition at line 275 of file CglFlowCover.hpp.

## getVubs() [1/2]

const CglFlowVUB * CglFlowCover::getVubs | ( |  | ) | const

inline private

Definition at line 290 of file CglFlowCover.hpp.

## getVubs() [2/2]

const CglFlowVUB & CglFlowCover::getVubs | ( | int | i | ) | const

inline private

Definition at line 291 of file CglFlowCover.hpp.

## setVubs() [1/2]

void CglFlowCover::setVubs | ( | CglFlowVUB * | vubs | ) |

inline private

Set CglFlowVUBs,take over the ownership.

Definition at line 293 of file CglFlowCover.hpp.

## setVubs() [2/2]

void CglFlowCover::setVubs | ( | const CglFlowVUB & | vub,
|  | int | i )

inline private

Definition at line 294 of file CglFlowCover.hpp.

## printVubs()

void CglFlowCover::printVubs | ( | std::ostream & | os | ) | const

inline private

Definition at line 304 of file CglFlowCover.hpp.

## getVlbs() [1/2]

const CglFlowVLB * CglFlowCover::getVlbs | ( |  | ) | const

inline private

Definition at line 314 of file CglFlowCover.hpp.

## getVlbs() [2/2]

const CglFlowVLB & CglFlowCover::getVlbs | ( | int | i | ) | const

inline private

Definition at line 315 of file CglFlowCover.hpp.

## setVlbs() [1/2]

void CglFlowCover::setVlbs | ( | CglFlowVLB * | vlbs | ) |

inline private

Set CglFlowVLBs,take over the ownership.

Definition at line 317 of file CglFlowCover.hpp.

## setVlbs() [2/2]

void CglFlowCover::setVlbs | ( | const CglFlowVLB & | vlb,
|  | int | i )

inline private

Definition at line 318 of file CglFlowCover.hpp.

## Friends And Related Symbol Documentation

## CglFlowCoverUnitTest

void CglFlowCoverUnitTest | ( | const OsiSolverInterface * | siP,
|  | const std::string | mpdDir )

friend

A function that tests the methods in the CglFlowCover 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

## maxNumCuts_

int CglFlowCover::maxNumCuts_

private

The maximum number of flow cuts to be generated.

Default is 1000.

Definition at line 335 of file CglFlowCover.hpp.

## EPSILON_

double CglFlowCover::EPSILON_

private

Tolerance used for numerical purpose.

Definition at line 337 of file CglFlowCover.hpp.

## UNDEFINED_

int CglFlowCover::UNDEFINED_

private

The variable upper bound of a flow is not indentified yet.

Definition at line 339 of file CglFlowCover.hpp.

## INFTY_

double CglFlowCover::INFTY_

private

Very large number.

Definition at line 341 of file CglFlowCover.hpp.

## TOLERANCE_

double CglFlowCover::TOLERANCE_

private

If violation of a cut is greater that this number, the cut is useful.

Definition at line 343 of file CglFlowCover.hpp.

## firstProcess_

bool CglFlowCover::firstProcess_

private

First time preprocessing.

Definition at line 345 of file CglFlowCover.hpp.

## numRows_

int CglFlowCover::numRows_

private

The number rows of the problem.

Definition at line 347 of file CglFlowCover.hpp.

## numCols_

int CglFlowCover::numCols_

private

The number columns of the problem.

Definition at line 349 of file CglFlowCover.hpp.

## numFlowCuts_

int CglFlowCover::numFlowCuts_

private

The number flow cuts found.

Definition at line 351 of file CglFlowCover.hpp.

## doneInitPre_

bool CglFlowCover::doneInitPre_

private

Indicate whether initial flow preprecessing has been done.

Definition at line 353 of file CglFlowCover.hpp.

## vubs_

CglFlowVUB* CglFlowCover::vubs_

private

The array of CglFlowVUBs.

Definition at line 355 of file CglFlowCover.hpp.

## vlbs_

CglFlowVLB* CglFlowCover::vlbs_

private

The array of CglFlowVLBs.

Definition at line 357 of file CglFlowCover.hpp.

## rowTypes_

CglFlowRowType* CglFlowCover::rowTypes_

private

CglFlowRowType of the rows in model.

Definition at line 359 of file CglFlowCover.hpp.

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

- Cgl/src/CglFlowCover/CglFlowCover.hpp