# CglResidualCapacity Class Reference

Residual Capacity Inequalities Cut Generator Class. More...

`#include <CglResidualCapacity.hpp>`

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

List of all members.

## Public Member Functions
Get and Set Parameters
void | setEpsilon (double value)
| Set Epsilon.
double | getEpsilon () const
| Get Epsilon.
void | setTolerance (double value)
| Set Tolerance.
double | getTolerance () const
| Get Tolerance.
void | setDoPreproc (int value)
| Set doPreproc.
bool | getDoPreproc () const
| Get doPreproc.
Generate Cuts
virtual void | generateCuts (const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info=CglTreeInfo()) const
| Generate Residual Capacity cuts for the model data contained in si.
Constructors and destructors
| CglResidualCapacity ()
| Default constructor.
| CglResidualCapacity (const double tolerance)
| Alternate Constructor.
| CglResidualCapacity (const CglResidualCapacity &)
| Copy constructor.
virtual CglCutGenerator * | clone () const
| Clone.
CglResidualCapacity & | operator= (const CglResidualCapacity &rhs)
| Assignment operator.
virtual | ~CglResidualCapacity ()
| Destructor.
virtual void | refreshPrep ()
| This is to refresh preprocessing.
## Private Types
enum | RowType { ROW_L, ROW_G, ROW_BOTH, ROW_OTHER }
## Private Member Functions
void | gutsOfConstruct (const double tolerance)
void | gutsOfDelete ()
void | gutsOfCopy (const CglResidualCapacity &rhs)
void | resCapPreprocess (const OsiSolverInterface &si) const
RowType | determineRowType (const OsiSolverInterface &si, const int rowLen, const int *ind, const double *coef, const char sense, const double rhs, const double *colLowerBound, const double *colUpperBound) const
bool | treatAsLessThan (const OsiSolverInterface &si, const int rowLen, const int *ind, const double *coef, const double rhs, const double *colLowerBound, const double *colUpperBound) const
void | generateResCapCuts (const OsiSolverInterface &si, const double *xlp, const double *colUpperBound, const double *colLowerBound, const CoinPackedMatrix &matrixByRow, const double *LHS, const double *coefByRow, const int *colInds, const int *rowStarts, const int *rowLengths, OsiCuts &cs) const
bool | resCapSeparation (const OsiSolverInterface &si, const int rowLen, const int *ind, const double *coef, const double rhs, const double *xlp, const double *colUpperBound, const double *colLowerBound, OsiRowCut &resCapCut) const
## Private Attributes
double | EPSILON_
| Tolerance used for numerical purposes, default value: 1.e-6.
double | TOLERANCE_
| If violation of a cut is greater that this number, the cut is accepted, default value: 1.e-4.
int | doPreproc_
| Controls the preprocessing of the matrix to identify rows suitable for cut generation.
int | numRows_
int | numCols_
bool | doneInitPre_
RowType * | rowTypes_
int * | indRows_
char * | sense_
double * | RHS_
int | numRowL_
int * | indRowL_
int | numRowG_
int * | indRowG_
## Friends
void | CglResidualCapacityUnitTest (const OsiSolverInterface *siP, const std::string mpdDir)
| A function that tests the methods in the CglResidualCapacity class.

## Detailed Description

Residual Capacity Inequalities Cut Generator Class.

References: T Magnanti, P Mirchandani, R Vachani, "The convex hull of two core capacitated network design problems," Math Programming 60 (1993), 233-250.

A Atamturk, D Rajan, "On splittable and unsplittable flow capacitated network design arc-set polyhedra," Math Programming 92 (2002), 315-333.

Definition at line 47 of file CglResidualCapacity.hpp.

## Member Enumeration Documentation

enum CglResidualCapacity::RowType`[private]`

Enumerator:

  ROW_L | row of the type a_1 c_1 + + a_k c_k - d z_1 - - d z_p <= b, where c_i are continuous variables and z_j are integer variables
  ROW_G | row of the type -a_1 c_1 - - a_k c_k + d z_1 + + d z_p >= b, where c_i are continuous variables and z_j are integer variables
  ROW_BOTH | equation that can be treated as ROW_L and ROW_G
  ROW_OTHER | Other types of rows.

Definition at line 56 of file CglResidualCapacity.hpp.

## Constructor & Destructor Documentation

CglResidualCapacity::CglResidualCapacity | ( |  | ) |

Default constructor.

CglResidualCapacity::CglResidualCapacity | ( | const double | tolerance | ) |

Alternate Constructor.

CglResidualCapacity::CglResidualCapacity | ( | const CglResidualCapacity & |  | ) |

Copy constructor.

virtual CglResidualCapacity::~CglResidualCapacity | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

void CglResidualCapacity::setEpsilon | ( | double | value | ) |

Set Epsilon.

double CglResidualCapacity::getEpsilon | ( |  | ) | const

Get Epsilon.

void CglResidualCapacity::setTolerance | ( | double | value | ) |

Set Tolerance.

double CglResidualCapacity::getTolerance | ( |  | ) | const

Get Tolerance.

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

Set doPreproc.

bool CglResidualCapacity::getDoPreproc | ( |  | ) | const

Get doPreproc.

virtual void CglResidualCapacity::generateCuts | ( | const OsiSolverInterface & | si,
|  | OsiCuts & | cs,
|  | const CglTreeInfo | info = `CglTreeInfo()` |
| ) |  |  | const`[virtual]`

Generate Residual Capacity cuts for the model data contained in si.

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

Implements CglCutGenerator.

virtual CglCutGenerator* CglResidualCapacity::clone | ( |  | ) | const`[virtual]`

Clone.

Implements CglCutGenerator.

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

Assignment operator.

Reimplemented from CglCutGenerator.

virtual void CglResidualCapacity::refreshPrep | ( |  | ) | `[virtual]`

This is to refresh preprocessing.

void CglResidualCapacity::gutsOfConstruct | ( | const double | tolerance | ) | `[private]`

void CglResidualCapacity::gutsOfDelete | ( |  | ) | `[private]`

void CglResidualCapacity::gutsOfCopy | ( | const CglResidualCapacity & | rhs | ) | `[private]`

void CglResidualCapacity::resCapPreprocess | ( | const OsiSolverInterface & | si | ) | const`[private]`

RowType CglResidualCapacity::determineRowType | ( | const OsiSolverInterface & | si,
|  | const int | rowLen,
|  | const int * | ind,
|  | const double * | coef,
|  | const char | sense,
|  | const double | rhs,
|  | const double * | colLowerBound,
|  | const double * | colUpperBound |
| ) |  |  | const`[private]`

bool CglResidualCapacity::treatAsLessThan | ( | const OsiSolverInterface & | si,
|  | const int | rowLen,
|  | const int * | ind,
|  | const double * | coef,
|  | const double | rhs,
|  | const double * | colLowerBound,
|  | const double * | colUpperBound |
| ) |  |  | const`[private]`

void CglResidualCapacity::generateResCapCuts | ( | const OsiSolverInterface & | si,
|  | const double * | xlp,
|  | const double * | colUpperBound,
|  | const double * | colLowerBound,
|  | const CoinPackedMatrix & | matrixByRow,
|  | const double * | LHS,
|  | const double * | coefByRow,
|  | const int * | colInds,
|  | const int * | rowStarts,
|  | const int * | rowLengths,
|  | OsiCuts & | cs |
| ) |  |  | const`[private]`

bool CglResidualCapacity::resCapSeparation | ( | const OsiSolverInterface & | si,
|  | const int | rowLen,
|  | const int * | ind,
|  | const double * | coef,
|  | const double | rhs,
|  | const double * | xlp,
|  | const double * | colUpperBound,
|  | const double * | colLowerBound,
|  | OsiRowCut & | resCapCut |
| ) |  |  | const`[private]`

## Friends And Related Function Documentation

void CglResidualCapacityUnitTest | ( | const OsiSolverInterface * | siP,
|  | const std::string | mpdDir |
| ) |  |  | `[friend]`

A function that tests the methods in the CglResidualCapacity 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 CglResidualCapacity::EPSILON_`[private]`

Tolerance used for numerical purposes, default value: 1.e-6.

Definition at line 194 of file CglResidualCapacity.hpp.

double CglResidualCapacity::TOLERANCE_`[private]`

If violation of a cut is greater that this number, the cut is accepted, default value: 1.e-4.

Definition at line 197 of file CglResidualCapacity.hpp.

int CglResidualCapacity::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 205 of file CglResidualCapacity.hpp.

int CglResidualCapacity::numRows_`[mutable, private]`

Definition at line 207 of file CglResidualCapacity.hpp.

int CglResidualCapacity::numCols_`[mutable, private]`

Definition at line 209 of file CglResidualCapacity.hpp.

bool CglResidualCapacity::doneInitPre_`[mutable, private]`

Definition at line 211 of file CglResidualCapacity.hpp.

RowType* CglResidualCapacity::rowTypes_`[mutable, private]`

Definition at line 213 of file CglResidualCapacity.hpp.

int* CglResidualCapacity::indRows_`[mutable, private]`

Definition at line 215 of file CglResidualCapacity.hpp.

char* CglResidualCapacity::sense_`[mutable, private]`

Definition at line 217 of file CglResidualCapacity.hpp.

double* CglResidualCapacity::RHS_`[mutable, private]`

Definition at line 219 of file CglResidualCapacity.hpp.

int CglResidualCapacity::numRowL_`[mutable, private]`

Definition at line 221 of file CglResidualCapacity.hpp.

int* CglResidualCapacity::indRowL_`[mutable, private]`

Definition at line 223 of file CglResidualCapacity.hpp.

int CglResidualCapacity::numRowG_`[mutable, private]`

Definition at line 225 of file CglResidualCapacity.hpp.

int* CglResidualCapacity::indRowG_`[mutable, private]`

Definition at line 227 of file CglResidualCapacity.hpp.

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

- /home/coin/svn-release/Alps-1.4.5/Cgl/src/CglResidualCapacity/CglResidualCapacity.hpp