Loading...
Searching...
No Matches
CglMixedIntegerRounding2 Class Reference

Mixed Integer Rounding Cut Generator Class. More...

`#include <CglMixedIntegerRounding2.hpp>`

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

## Public Member Functions

Generate Cuts
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo())
| Generate Mixed Integer Rounding cuts for the model data contained in si.
Constructors and destructors
| CglMixedIntegerRounding2 ()
| Default constructor.
| CglMixedIntegerRounding2 (const int maxaggr, const bool multiply, const int criterion, const int preproc=-1)
| Alternate Constructor.
| CglMixedIntegerRounding2 (const CglMixedIntegerRounding2 &)
| Copy constructor.
virtual CglCutGenerator * | clone () const
| Clone.
CglMixedIntegerRounding2 & | operator= (const CglMixedIntegerRounding2 &rhs)
| Assignment operator.
virtual | ~CglMixedIntegerRounding2 ()
| Destructor.
virtual void | refreshSolver (OsiSolverInterface *solver)
| This can be used to refresh any inforamtion.
virtual std::string | generateCpp (FILE *fp)
| Create C++ lines to get to current state.
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).
virtual bool | needsOptimalBasis () const
| Return true if needs optimal basis to do cuts.
virtual int | maximumLengthOfCutInTree () const
| Return maximum length of cut in tree.

## Private Types

enum | RowType { ROW_UNDEFINED , ROW_VARUB , ROW_VARLB , ROW_VAREQ , ROW_MIX , ROW_CONT , ROW_INT , ROW_OTHER }

## Friends

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

## Set and get methods

int | MAXAGGR_
bool | MULTIPLY_
int | CRITERION_
double | EPSILON_
int | UNDEFINED_
| There is no variable upper bound or variable lower bound defined.
double | TOLERANCE_
int | doPreproc_
| Controls the preprocessing of the matrix to identify rows suitable for cut generation.
int | numRows_
int | numCols_
bool | doneInitPre_
CglMixIntRoundVUB2 * | vubs_
CglMixIntRoundVLB2 * | vlbs_
RowType * | rowTypes_
int * | indRows_
int | numRowMix_
int * | indRowMix_
int | numRowCont_
int * | indRowCont_
int | numRowInt_
int * | indRowInt_
int | numRowContVB_
int * | indRowContVB_
char * | integerType_
char * | sense_
double * | RHS_
void | setMAXAGGR_ (int maxaggr)
| Set MAXAGGR_.
int | getMAXAGGR_ () const
| Get MAXAGGR_.
void | setMULTIPLY_ (bool multiply)
| Set MULTIPLY_.
bool | getMULTIPLY_ () const
| Get MULTIPLY_.
void | setCRITERION_ (int criterion)
| Set CRITERION_.
int | getCRITERION_ () const
| Get CRITERION_.
void | setDoPreproc (int value)
| Set doPreproc.
bool | getDoPreproc () const
| Get doPreproc.
void | gutsOfConstruct (const int maxaggr, const bool multiply, const int criterion, const int preproc)
void | gutsOfDelete ()
void | gutsOfCopy (const CglMixedIntegerRounding2 &rhs)
void | mixIntRoundPreprocess (const OsiSolverInterface &si)
RowType | determineRowType (const int rowLen, const int *ind, const double *coef, const char sense, const double rhs) const
void | generateMirCuts (const OsiSolverInterface &si, const double *xlp, const double *colUpperBound, const double *colLowerBound, const CoinPackedMatrix &matrixByRow, const double *LHS, const double *coefByCol, const int *rowInds, const CoinBigIndex *colStarts, OsiCuts &cs) const
void | copyRowSelected (const int iAggregate, const int rowSelected, CoinIndexedVector &setRowsAggregated, int *listRowsAggregated, double *xlpExtra, const char sen, const double rhs, const double lhs, const CoinPackedMatrix &matrixByRow, CoinIndexedVector &rowToAggregate, double &rhsToAggregate) const
bool | selectRowToAggregate (const CoinIndexedVector &rowAggregated, const double *colUpperBound, const double *colLowerBound, const CoinIndexedVector &setRowsAggregated, const double *xlp, const double *coefByCol, const int *rowInds, const CoinBigIndex *colStarts, int &rowSelected, int &colSelected) const
void | aggregateRow (const int colSelected, CoinIndexedVector &rowToAggregate, double rhs, CoinIndexedVector &rowAggregated, double &rhsAggregated) const
bool | isLowerSubst (const double inf, const double aj, const double xlp, const double LB, const double UB) const
bool | boundSubstitution (const OsiSolverInterface &si, const CoinIndexedVector &rowAggregated, const double *xlp, const double *xlpExtra, const double *colUpperBound, const double *colLowerBound, CoinIndexedVector &mixedKnapsack, double &rhsMixedKnapsack, double &sStar, CoinIndexedVector &contVariablesInS) const

bool

cMirSeparation (const OsiSolverInterface &si, const CoinPackedMatrix &matrixByRow, const CoinIndexedVector &rowAggregated, const int *listRowsAggregated, const char *sense, const double *RHS, const double *xlp, const double sStar, const double *colUpperBound, const double *colLowerBound, const CoinIndexedVector &mixedKnapsack, const double &rhsMixedKnapsack, const CoinIndexedVector &contVariablesInS, CoinIndexedVector *workVector, OsiRowCut &flowCut) const

void | cMirInequality (const int numInt, const double delta, const double numeratorBeta, const int *knapsackIndices, const double *knapsackElements, const double *xlp, const double sStar, const double *colUpperBound, const CoinIndexedVector &setC, CoinIndexedVector &cMIR, double &rhscMIR, double &sCoef, double &violation) const
double | functionG (const double d, const double f) const
void | printStats (std::ofstream &fout, const bool hasCut, const OsiSolverInterface &si, const CoinIndexedVector &rowAggregated, const double &rhsAggregated, const double *xlp, const double *xlpExtra, const int *listRowsAggregated, const int *listColsSelected, const int level, const double *colUpperBound, const double *colLowerBound) const

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

Mixed Integer Rounding Cut Generator Class.

Definition at line 87 of file CglMixedIntegerRounding2.hpp.

## Member Enumeration Documentation

## RowType

enum CglMixedIntegerRounding2::RowType

private

Enumerator
ROW_UNDEFINED |
ROW_VARUB | After the row is flipped to 'L', the row has exactly two variables: one is negative binary and the other is a continous, and the RHS is zero.
ROW_VARLB | After the row is flipped to 'L', the row has exactly two variables: one is positive binary and the other is a continous, and the RHS is zero.
ROW_VAREQ | The row sense is 'E', the row has exactly two variables: one is binary and the other is a continous, and the RHS is zero.
ROW_MIX |
ROW_CONT |
ROW_INT |
ROW_OTHER |

Definition at line 96 of file CglMixedIntegerRounding2.hpp.

## Constructor & Destructor Documentation

## CglMixedIntegerRounding2() [1/3]

CglMixedIntegerRounding2::CglMixedIntegerRounding2 | ( |  | ) |

Default constructor.

## CglMixedIntegerRounding2() [2/3]

CglMixedIntegerRounding2::CglMixedIntegerRounding2 | ( | const int | maxaggr,
|  | const bool | multiply,
|  | const int | criterion,
|  | const int | preproc = -1 )

Alternate Constructor.

## CglMixedIntegerRounding2() [3/3]

CglMixedIntegerRounding2::CglMixedIntegerRounding2 | ( | const CglMixedIntegerRounding2 & |  | ) |

Copy constructor.

## ~CglMixedIntegerRounding2()

virtual CglMixedIntegerRounding2::~CglMixedIntegerRounding2 | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## generateCuts()

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

virtual

Generate Mixed Integer Rounding cuts for the model data contained in si.

The generated cuts are inserted in the collection of cuts cs.

Implements CglCutGenerator.

## clone()

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

virtual

Clone.

Implements CglCutGenerator.

## operator=()

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

Assignment operator.

## refreshSolver()

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

virtual

This can be used to refresh any inforamtion.

Reimplemented from CglCutGenerator.

## generateCpp()

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

virtual

Create C++ lines to get to current state.

Reimplemented from CglCutGenerator.

## setMAXAGGR_()

void CglMixedIntegerRounding2::setMAXAGGR_ | ( | int | maxaggr | ) |

inline

Set MAXAGGR_.

Definition at line 171 of file CglMixedIntegerRounding2.hpp.

## getMAXAGGR_()

int CglMixedIntegerRounding2::getMAXAGGR_ | ( |  | ) | const

inline

Get MAXAGGR_.

Definition at line 182 of file CglMixedIntegerRounding2.hpp.

## setMULTIPLY_()

void CglMixedIntegerRounding2::setMULTIPLY_ | ( | bool | multiply | ) |

inline

Set MULTIPLY_.

Definition at line 185 of file CglMixedIntegerRounding2.hpp.

## getMULTIPLY_()

bool CglMixedIntegerRounding2::getMULTIPLY_ | ( |  | ) | const

inline

Get MULTIPLY_.

Definition at line 188 of file CglMixedIntegerRounding2.hpp.

## setCRITERION_()

void CglMixedIntegerRounding2::setCRITERION_ | ( | int | criterion | ) |

inline

Set CRITERION_.

Definition at line 191 of file CglMixedIntegerRounding2.hpp.

## getCRITERION_()

int CglMixedIntegerRounding2::getCRITERION_ | ( |  | ) | const

inline

Get CRITERION_.

Definition at line 202 of file CglMixedIntegerRounding2.hpp.

## setDoPreproc()

void CglMixedIntegerRounding2::setDoPreproc | ( | int | value | ) |

Set doPreproc.

## getDoPreproc()

bool CglMixedIntegerRounding2::getDoPreproc | ( |  | ) | const

Get doPreproc.

## gutsOfConstruct()

void CglMixedIntegerRounding2::gutsOfConstruct | ( | const int | maxaggr,
|  | const bool | multiply,
|  | const int | criterion,
|  | const int | preproc )

private

## gutsOfDelete()

void CglMixedIntegerRounding2::gutsOfDelete | ( |  | ) |

private

## gutsOfCopy()

void CglMixedIntegerRounding2::gutsOfCopy | ( | const CglMixedIntegerRounding2 & | rhs | ) |

private

## mixIntRoundPreprocess()

void CglMixedIntegerRounding2::mixIntRoundPreprocess | ( | const OsiSolverInterface & | si | ) |

private

## determineRowType()

RowType CglMixedIntegerRounding2::determineRowType | ( | const int | rowLen,
|  | const int * | ind,
|  | const double * | coef,
|  | const char | sense,
|  | const double | rhs ) const

private

## generateMirCuts()

void CglMixedIntegerRounding2::generateMirCuts | ( | const OsiSolverInterface & | si,
|  | const double * | xlp,
|  | const double * | colUpperBound,
|  | const double * | colLowerBound,
|  | const CoinPackedMatrix & | matrixByRow,
|  | const double * | LHS,
|  | const double * | coefByCol,
|  | const int * | rowInds,
|  | const CoinBigIndex * | colStarts,
|  | OsiCuts & | cs ) const

private

## copyRowSelected()

void CglMixedIntegerRounding2::copyRowSelected | ( | const int | iAggregate,
|  | const int | rowSelected,
|  | CoinIndexedVector & | setRowsAggregated,
|  | int * | listRowsAggregated,
|  | double * | xlpExtra,
|  | const char | sen,
|  | const double | rhs,
|  | const double | lhs,
|  | const CoinPackedMatrix & | matrixByRow,
|  | CoinIndexedVector & | rowToAggregate,
|  | double & | rhsToAggregate ) const

private

## selectRowToAggregate()

bool CglMixedIntegerRounding2::selectRowToAggregate | ( | const CoinIndexedVector & | rowAggregated,
|  | const double * | colUpperBound,
|  | const double * | colLowerBound,
|  | const CoinIndexedVector & | setRowsAggregated,
|  | const double * | xlp,
|  | const double * | coefByCol,
|  | const int * | rowInds,
|  | const CoinBigIndex * | colStarts,
|  | int & | rowSelected,
|  | int & | colSelected ) const

private

## aggregateRow()

void CglMixedIntegerRounding2::aggregateRow | ( | const int | colSelected,
|  | CoinIndexedVector & | rowToAggregate,
|  | double | rhs,
|  | CoinIndexedVector & | rowAggregated,
|  | double & | rhsAggregated ) const

private

## isLowerSubst()

bool CglMixedIntegerRounding2::isLowerSubst | ( | const double | inf,
|  | const double | aj,
|  | const double | xlp,
|  | const double | LB,
|  | const double | UB ) const

inline private

## boundSubstitution()

bool CglMixedIntegerRounding2::boundSubstitution | ( | const OsiSolverInterface & | si,
|  | const CoinIndexedVector & | rowAggregated,
|  | const double * | xlp,
|  | const double * | xlpExtra,
|  | const double * | colUpperBound,
|  | const double * | colLowerBound,
|  | CoinIndexedVector & | mixedKnapsack,
|  | double & | rhsMixedKnapsack,
|  | double & | sStar,
|  | CoinIndexedVector & | contVariablesInS ) const

private

## cMirSeparation()

bool CglMixedIntegerRounding2::cMirSeparation | ( | const OsiSolverInterface & | si,
|  | const CoinPackedMatrix & | matrixByRow,
|  | const CoinIndexedVector & | rowAggregated,
|  | const int * | listRowsAggregated,
|  | const char * | sense,
|  | const double * | RHS,
|  | const double * | xlp,
|  | const double | sStar,
|  | const double * | colUpperBound,
|  | const double * | colLowerBound,
|  | const CoinIndexedVector & | mixedKnapsack,
|  | const double & | rhsMixedKnapsack,
|  | const CoinIndexedVector & | contVariablesInS,
|  | CoinIndexedVector * | workVector,
|  | OsiRowCut & | flowCut ) const

private

## cMirInequality()

void CglMixedIntegerRounding2::cMirInequality | ( | const int | numInt,
|  | const double | delta,
|  | const double | numeratorBeta,
|  | const int * | knapsackIndices,
|  | const double * | knapsackElements,
|  | const double * | xlp,
|  | const double | sStar,
|  | const double * | colUpperBound,
|  | const CoinIndexedVector & | setC,
|  | CoinIndexedVector & | cMIR,
|  | double & | rhscMIR,
|  | double & | sCoef,
|  | double & | violation ) const

private

## functionG()

double CglMixedIntegerRounding2::functionG | ( | const double | d,
|  | const double | f ) const

inline private

## printStats()

void CglMixedIntegerRounding2::printStats | ( | std::ofstream & | fout,
|  | const bool | hasCut,
|  | const OsiSolverInterface & | si,
|  | const CoinIndexedVector & | rowAggregated,
|  | const double & | rhsAggregated,
|  | const double * | xlp,
|  | const double * | xlpExtra,
|  | const int * | listRowsAggregated,
|  | const int * | listColsSelected,
|  | const int | level,
|  | const double * | colUpperBound,
|  | const double * | colLowerBound ) const

private

## Friends And Related Symbol Documentation

## CglMixedIntegerRounding2UnitTest

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

friend

## Member Data Documentation

## MAXAGGR_

int CglMixedIntegerRounding2::MAXAGGR_

private

Definition at line 358 of file CglMixedIntegerRounding2.hpp.

## MULTIPLY_

bool CglMixedIntegerRounding2::MULTIPLY_

private

Definition at line 360 of file CglMixedIntegerRounding2.hpp.

## CRITERION_

int CglMixedIntegerRounding2::CRITERION_

private

Definition at line 362 of file CglMixedIntegerRounding2.hpp.

## EPSILON_

double CglMixedIntegerRounding2::EPSILON_

private

Definition at line 364 of file CglMixedIntegerRounding2.hpp.

## UNDEFINED_

int CglMixedIntegerRounding2::UNDEFINED_

private

There is no variable upper bound or variable lower bound defined.

Definition at line 366 of file CglMixedIntegerRounding2.hpp.

## TOLERANCE_

double CglMixedIntegerRounding2::TOLERANCE_

private

Definition at line 368 of file CglMixedIntegerRounding2.hpp.

## doPreproc_

int CglMixedIntegerRounding2::doPreproc_

private

Controls the preprocessing of the matrix to identify rows suitable for cut generation.

- -1: preprocess according to solver settings;
- 0: Do preprocessing only if it has not yet been done;
- 1: Do preprocessing.

Default value: -1

Definition at line 376 of file CglMixedIntegerRounding2.hpp.

## numRows_

int CglMixedIntegerRounding2::numRows_

private

Definition at line 378 of file CglMixedIntegerRounding2.hpp.

## numCols_

int CglMixedIntegerRounding2::numCols_

private

Definition at line 380 of file CglMixedIntegerRounding2.hpp.

## doneInitPre_

bool CglMixedIntegerRounding2::doneInitPre_

private

Definition at line 382 of file CglMixedIntegerRounding2.hpp.

## vubs_

CglMixIntRoundVUB2* CglMixedIntegerRounding2::vubs_

private

Definition at line 384 of file CglMixedIntegerRounding2.hpp.

## vlbs_

CglMixIntRoundVLB2* CglMixedIntegerRounding2::vlbs_

private

Definition at line 386 of file CglMixedIntegerRounding2.hpp.

## rowTypes_

RowType* CglMixedIntegerRounding2::rowTypes_

private

Definition at line 388 of file CglMixedIntegerRounding2.hpp.

## indRows_

int* CglMixedIntegerRounding2::indRows_

private

Definition at line 390 of file CglMixedIntegerRounding2.hpp.

## numRowMix_

int CglMixedIntegerRounding2::numRowMix_

private

Definition at line 392 of file CglMixedIntegerRounding2.hpp.

## indRowMix_

int* CglMixedIntegerRounding2::indRowMix_

private

Definition at line 394 of file CglMixedIntegerRounding2.hpp.

## numRowCont_

int CglMixedIntegerRounding2::numRowCont_

private

Definition at line 396 of file CglMixedIntegerRounding2.hpp.

## indRowCont_

int* CglMixedIntegerRounding2::indRowCont_

private

Definition at line 398 of file CglMixedIntegerRounding2.hpp.

## numRowInt_

int CglMixedIntegerRounding2::numRowInt_

private

Definition at line 400 of file CglMixedIntegerRounding2.hpp.

## indRowInt_

int* CglMixedIntegerRounding2::indRowInt_

private

Definition at line 402 of file CglMixedIntegerRounding2.hpp.

## numRowContVB_

int CglMixedIntegerRounding2::numRowContVB_

private

Definition at line 405 of file CglMixedIntegerRounding2.hpp.

## indRowContVB_

int* CglMixedIntegerRounding2::indRowContVB_

private

Definition at line 408 of file CglMixedIntegerRounding2.hpp.

## integerType_

char* CglMixedIntegerRounding2::integerType_

private

Definition at line 410 of file CglMixedIntegerRounding2.hpp.

## sense_

char* CglMixedIntegerRounding2::sense_

private

Definition at line 412 of file CglMixedIntegerRounding2.hpp.

## RHS_

double* CglMixedIntegerRounding2::RHS_

private

Definition at line 414 of file CglMixedIntegerRounding2.hpp.

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

- Cgl/src/CglMixedIntegerRounding2/CglMixedIntegerRounding2.hpp