- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# OsiCuts Class Reference

Collections of row cuts and column cuts. More...

`#include <OsiCuts.hpp>`

List of all members.

## Public Member Functions
Inserting a cut into collection
void | insert (const OsiRowCut &rc)
| Insert a row cut.
void | insertIfNotDuplicate (OsiRowCut &rc, CoinAbsFltEq treatAsSame=CoinAbsFltEq(1.0e-12))
| Insert a row cut unless it is a duplicate - cut may get sorted.
void | insertIfNotDuplicate (OsiRowCut &rc, CoinRelFltEq treatAsSame)
| Insert a row cut unless it is a duplicate - cut may get sorted.
void | insert (const OsiColCut &cc)
| Insert a column cut.
void | insert (OsiRowCut *&rcPtr)
| Insert a row cut.
void | insert (OsiColCut *&ccPtr)
| Insert a column cut.
void | insert (const OsiCuts &cs)
| Insert a set of cuts.
Number of cuts in collection
int | sizeRowCuts () const
| Number of row cuts in collection.
int | sizeColCuts () const
| Number of column cuts in collection.
int | sizeCuts () const
| Number of cuts in collection.
Debug stuff
void | printCuts () const
| Print cuts in collection.
Get a cut from collection
OsiRowCut * | rowCutPtr (int i)
| Get pointer to i'th row cut.
const OsiRowCut * | rowCutPtr (int i) const
| Get const pointer to i'th row cut.
OsiColCut * | colCutPtr (int i)
| Get pointer to i'th column cut.
const OsiColCut * | colCutPtr (int i) const
| Get const pointer to i'th column cut.
OsiRowCut & | rowCut (int i)
| Get reference to i'th row cut.
const OsiRowCut & | rowCut (int i) const
| Get const reference to i'th row cut.
OsiColCut & | colCut (int i)
| Get reference to i'th column cut.
const OsiColCut & | colCut (int i) const
| Get const reference to i'th column cut.
const OsiCut * | mostEffectiveCutPtr () const
| Get const pointer to the most effective cut.
OsiCut * | mostEffectiveCutPtr ()
| Get pointer to the most effective cut.
Deleting cut from collection
void | eraseRowCut (int i)
| Remove i'th row cut from collection.
void | eraseColCut (int i)
| Remove i'th column cut from collection.
OsiRowCut * | rowCutPtrAndZap (int i)
| Get pointer to i'th row cut and remove ptr from collection.
void | dumpCuts ()
| Clear all row cuts without deleting them.
void | eraseAndDumpCuts (const std::vector< int > to_erase)
| Selective delete and clear for row cuts.
Sorting collection
void | sort ()
| Cuts with greatest effectiveness are first.
Iterators
Example of using an iterator to sum effectiveness of all cuts in the collection.
         double sumEff=0.0;
         for ( OsiCuts::iterator it=cuts.begin(); it!=cuts.end(); ++it )
               sumEff+= (*it)->effectiveness();
iterator | begin ()
| Get iterator to beginning of collection.
const_iterator | begin () const
| Get const iterator to beginning of collection.
iterator | end ()
| Get iterator to end of collection.
const_iterator | end () const
| Get const iterator to end of collection.
Constructors and destructors
| OsiCuts ()
| Default constructor.
| OsiCuts (const OsiCuts &)
| Copy constructor.
OsiCuts & | operator= (const OsiCuts &rhs)
| Assignment operator.
virtual | ~OsiCuts ()
| Destructor.
## Private Member Functions
Private methods
void | gutsOfCopy (const OsiCuts &source)
| Copy internal data.
void | gutsOfDestructor ()
| Delete internal data.
## Private Attributes
Private member data
OsiVectorRowCutPtr | rowCutPtrs_
| Vector of row cuts pointers.
OsiVectorColCutPtr | colCutPtrs_
| Vector of column cuts pointers.
## Friends
void | OsiCutsUnitTest ()
| A function that tests the methods in the OsiCuts class.
## Classes
class | const_iterator
| Const Iterator. More...
class | iterator
| Iterator. More...
class | OsiCutCompare

## Detailed Description

Collections of row cuts and column cuts.

Definition at line 20 of file OsiCuts.hpp.

## Constructor & Destructor Documentation

OsiCuts::OsiCuts | ( |  | ) |

Default constructor.

OsiCuts::OsiCuts | ( | const OsiCuts & |  | ) |

Copy constructor.

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

Destructor.

## Member Function Documentation

void OsiCuts::insert | ( | const OsiRowCut & | rc | ) | `[inline]`

Insert a row cut.

Definition at line 307 of file OsiCuts.hpp.

References OsiRowCut::clone(), and rowCutPtrs_.

Referenced by insert().

void OsiCuts::insertIfNotDuplicate | ( | OsiRowCut & | rc,
|  | CoinAbsFltEq | treatAsSame = `CoinAbsFltEq(1.0e-12)` |
| ) |  |  |

Insert a row cut unless it is a duplicate - cut may get sorted.

Duplicate is defined as CoinAbsFltEq says same

void OsiCuts::insertIfNotDuplicate | ( | OsiRowCut & | rc,
|  | CoinRelFltEq | treatAsSame |
| ) |  |  |

Insert a row cut unless it is a duplicate - cut may get sorted.

Duplicate is defined as CoinRelFltEq says same

void OsiCuts::insert | ( | const OsiColCut & | cc | ) | `[inline]`

Insert a column cut.

Definition at line 313 of file OsiCuts.hpp.

References OsiColCut::clone(), and colCutPtrs_.

void OsiCuts::insert | ( | OsiRowCut *& | rcPtr | ) | `[inline]`

Insert a row cut.

The OsiCuts object takes control of the cut object. On return, `rcPtr` is NULL.

Definition at line 320 of file OsiCuts.hpp.

References rowCutPtrs_.

void OsiCuts::insert | ( | OsiColCut *& | ccPtr | ) | `[inline]`

Insert a column cut.

The OsiCuts object takes control of the cut object. On return `ccPtr` is NULL.

Definition at line 325 of file OsiCuts.hpp.

References colCutPtrs_.

void OsiCuts::insert | ( | const OsiCuts & | cs | ) | `[inline]`

Insert a set of cuts.

Definition at line 348 of file OsiCuts.hpp.

References begin(), end(), and insert().

int OsiCuts::sizeRowCuts | ( |  | ) | const`[inline]`

Number of row cuts in collection.

Definition at line 375 of file OsiCuts.hpp.

References rowCutPtrs_.

Referenced by printCuts(), and sizeCuts().

int OsiCuts::sizeColCuts | ( |  | ) | const`[inline]`

Number of column cuts in collection.

Definition at line 376 of file OsiCuts.hpp.

References colCutPtrs_.

Referenced by printCuts(), and sizeCuts().

int OsiCuts::sizeCuts | ( |  | ) | const`[inline]`

Number of cuts in collection.

Definition at line 377 of file OsiCuts.hpp.

References sizeColCuts(), and sizeRowCuts().

void OsiCuts::printCuts | ( |  | ) | const`[inline]`

Print cuts in collection.

Definition at line 421 of file OsiCuts.hpp.

References colCutPtr(), OsiRowCut::print(), OsiColCut::print(), rowCutPtr(), sizeColCuts(), and sizeRowCuts().

OsiRowCut * OsiCuts::rowCutPtr | ( | int | i | ) | `[inline]`

Get pointer to i'th row cut.

Definition at line 384 of file OsiCuts.hpp.

References rowCutPtrs_.

Referenced by printCuts(), and rowCut().

const OsiRowCut * OsiCuts::rowCutPtr | ( | int | i | ) | const`[inline]`

Get const pointer to i'th row cut.

Definition at line 382 of file OsiCuts.hpp.

References rowCutPtrs_.

OsiColCut * OsiCuts::colCutPtr | ( | int | i | ) | `[inline]`

Get pointer to i'th column cut.

Definition at line 385 of file OsiCuts.hpp.

References colCutPtrs_.

Referenced by colCut(), and printCuts().

const OsiColCut * OsiCuts::colCutPtr | ( | int | i | ) | const`[inline]`

Get const pointer to i'th column cut.

Definition at line 383 of file OsiCuts.hpp.

References colCutPtrs_.

OsiRowCut & OsiCuts::rowCut | ( | int | i | ) | `[inline]`

Get reference to i'th row cut.

Definition at line 389 of file OsiCuts.hpp.

References rowCutPtr().

const OsiRowCut & OsiCuts::rowCut | ( | int | i | ) | const`[inline]`

Get const reference to i'th row cut.

Definition at line 387 of file OsiCuts.hpp.

References rowCutPtr().

OsiColCut & OsiCuts::colCut | ( | int | i | ) | `[inline]`

Get reference to i'th column cut.

Definition at line 390 of file OsiCuts.hpp.

References colCutPtr().

const OsiColCut & OsiCuts::colCut | ( | int | i | ) | const`[inline]`

Get const reference to i'th column cut.

Definition at line 388 of file OsiCuts.hpp.

References colCutPtr().

const OsiCut * OsiCuts::mostEffectiveCutPtr | ( |  | ) | const`[inline]`

Get const pointer to the most effective cut.

Definition at line 395 of file OsiCuts.hpp.

References begin(), and end().

OsiCut * OsiCuts::mostEffectiveCutPtr | ( |  | ) | `[inline]`

Get pointer to the most effective cut.

Definition at line 401 of file OsiCuts.hpp.

References begin(), and end().

void OsiCuts::eraseRowCut | ( | int | i | ) | `[inline]`

Remove i'th row cut from collection.

Definition at line 440 of file OsiCuts.hpp.

References rowCutPtrs_.

void OsiCuts::eraseColCut | ( | int | i | ) | `[inline]`

Remove i'th column cut from collection.

Definition at line 445 of file OsiCuts.hpp.

References colCutPtrs_.

OsiRowCut * OsiCuts::rowCutPtrAndZap | ( | int | i | ) | `[inline]`

Get pointer to i'th row cut and remove ptr from collection.

Definition at line 452 of file OsiCuts.hpp.

References rowCutPtrs_.

void OsiCuts::dumpCuts | ( |  | ) | `[inline]`

Clear all row cuts without deleting them.

Handy in case one wants to use CGL without managing cuts in one of the OSI containers. Client is ultimately responsible for deleting the data structures holding the row cuts.

Definition at line 459 of file OsiCuts.hpp.

References rowCutPtrs_.

void OsiCuts::eraseAndDumpCuts | ( | const std::vector< int > | to_erase | ) | `[inline]`

Selective delete and clear for row cuts.

Deletes the cuts specified in `to_erase` then clears remaining cuts without deleting them. A hybrid of eraseRowCut(int) and dumpCuts(). Client is ultimately responsible for deleting the data structures for row cuts not specified in `to_erase`.

Definition at line 463 of file OsiCuts.hpp.

References rowCutPtrs_.

void OsiCuts::sort | ( |  | ) | `[inline]`

Cuts with greatest effectiveness are first.

Definition at line 365 of file OsiCuts.hpp.

References colCutPtrs_, and rowCutPtrs_.

iterator OsiCuts::begin | ( |  | ) | `[inline]`

Get iterator to beginning of collection.

Definition at line 248 of file OsiCuts.hpp.

References OsiCuts::iterator::begin().

Referenced by insert(), and mostEffectiveCutPtr().

const_iterator OsiCuts::begin | ( |  | ) | const`[inline]`

Get const iterator to beginning of collection.

Definition at line 250 of file OsiCuts.hpp.

References OsiCuts::const_iterator::begin().

iterator OsiCuts::end | ( |  | ) | `[inline]`

Get iterator to end of collection.

Definition at line 252 of file OsiCuts.hpp.

References OsiCuts::iterator::end().

Referenced by insert(), and mostEffectiveCutPtr().

const_iterator OsiCuts::end | ( |  | ) | const`[inline]`

Get const iterator to end of collection.

Definition at line 254 of file OsiCuts.hpp.

References OsiCuts::const_iterator::end().

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

Assignment operator.

void OsiCuts::gutsOfCopy | ( | const OsiCuts & | source | ) | `[private]`

Copy internal data.

void OsiCuts::gutsOfDestructor | ( |  | ) | `[private]`

Delete internal data.

## Friends And Related Function Documentation

void OsiCutsUnitTest | ( |  | ) | `[friend]`

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

OsiVectorRowCutPtr OsiCuts::rowCutPtrs_`[private]`

Vector of row cuts pointers.

Definition at line 296 of file OsiCuts.hpp.

Referenced by dumpCuts(), eraseAndDumpCuts(), eraseRowCut(), insert(), rowCutPtr(), rowCutPtrAndZap(), sizeRowCuts(), and sort().

OsiVectorColCutPtr OsiCuts::colCutPtrs_`[private]`

Vector of column cuts pointers.

Definition at line 298 of file OsiCuts.hpp.

Referenced by colCutPtr(), eraseColCut(), insert(), sizeColCuts(), and sort().

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

- /home/coin/SVN-release/Osi-0.98.1/Osi/src/OsiCuts.hpp