Cbc  2.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Friends | List of all members
OsiCuts Class Reference

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

#include <OsiCuts.hpp>

+ Collaboration diagram for OsiCuts:

Classes

class  const_iterator
 Const Iterator. More...
 
class  iterator
 Iterator. More...
 
class  OsiCutCompare
 

Public Member Functions

Inserting a cut into collection
void insert (const OsiRowCut &rc)
 Insert a row cut. More...
 
void insertIfNotDuplicate (OsiRowCut &rc, CoinAbsFltEq treatAsSame=CoinAbsFltEq(1.0e-12))
 Insert a row cut unless it is a duplicate - cut may get sorted. More...
 
void insertIfNotDuplicate (OsiRowCut &rc, CoinRelFltEq treatAsSame)
 Insert a row cut unless it is a duplicate - cut may get sorted. More...
 
void insert (const OsiColCut &cc)
 Insert a column cut. More...
 
void insert (OsiRowCut *&rcPtr)
 Insert a row cut. More...
 
void insert (OsiColCut *&ccPtr)
 Insert a column cut. More...
 
void insert (const OsiCuts &cs)
 Insert a set of cuts. More...
 
Number of cuts in collection
int sizeRowCuts () const
 Number of row cuts in collection. More...
 
int sizeColCuts () const
 Number of column cuts in collection. More...
 
int sizeCuts () const
 Number of cuts in collection. More...
 
Debug stuff
void printCuts () const
 Print cuts in collection. More...
 
Get a cut from collection
OsiRowCutrowCutPtr (int i)
 Get pointer to i'th row cut. More...
 
const OsiRowCutrowCutPtr (int i) const
 Get const pointer to i'th row cut. More...
 
OsiColCutcolCutPtr (int i)
 Get pointer to i'th column cut. More...
 
const OsiColCutcolCutPtr (int i) const
 Get const pointer to i'th column cut. More...
 
OsiRowCutrowCut (int i)
 Get reference to i'th row cut. More...
 
const OsiRowCutrowCut (int i) const
 Get const reference to i'th row cut. More...
 
OsiColCutcolCut (int i)
 Get reference to i'th column cut. More...
 
const OsiColCutcolCut (int i) const
 Get const reference to i'th column cut. More...
 
const OsiCutmostEffectiveCutPtr () const
 Get const pointer to the most effective cut. More...
 
OsiCutmostEffectiveCutPtr ()
 Get pointer to the most effective cut. More...
 
Deleting cut from collection
void eraseRowCut (int i)
 Remove i'th row cut from collection. More...
 
void eraseColCut (int i)
 Remove i'th column cut from collection. More...
 
OsiRowCutrowCutPtrAndZap (int i)
 Get pointer to i'th row cut and remove ptr from collection. More...
 
void dumpCuts ()
 Clear all row cuts without deleting them. More...
 
void eraseAndDumpCuts (const std::vector< int > to_erase)
 Selective delete and clear for row cuts. More...
 
Sorting collection
void sort ()
 Cuts with greatest effectiveness are first. More...
 
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. More...
 
const_iterator begin () const
 Get const iterator to beginning of collection. More...
 
iterator end ()
 Get iterator to end of collection. More...
 
const_iterator end () const
 Get const iterator to end of collection. More...
 
Constructors and destructors
 OsiCuts ()
 Default constructor. More...
 
 OsiCuts (const OsiCuts &)
 Copy constructor. More...
 
OsiCutsoperator= (const OsiCuts &rhs)
 Assignment operator. More...
 
virtual ~OsiCuts ()
 Destructor. More...
 

Private Member Functions

Private methods
void gutsOfCopy (const OsiCuts &source)
 Copy internal data. More...
 
void gutsOfDestructor ()
 Delete internal data. More...
 

Private Attributes

Private member data
OsiVectorRowCutPtr rowCutPtrs_
 Vector of row cuts pointers. More...
 
OsiVectorColCutPtr colCutPtrs_
 Vector of column cuts pointers. More...
 

Friends

void OsiCutsUnitTest ()
 A function that tests the methods in the OsiCuts class. More...
 

Detailed Description

Collections of row cuts and column cuts.

Definition at line 19 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 306 of file OsiCuts.hpp.

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 312 of file OsiCuts.hpp.

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 319 of file OsiCuts.hpp.

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 324 of file OsiCuts.hpp.

void OsiCuts::insert ( const OsiCuts cs)
inline

Insert a set of cuts.

Definition at line 347 of file OsiCuts.hpp.

int OsiCuts::sizeRowCuts ( ) const
inline

Number of row cuts in collection.

Definition at line 374 of file OsiCuts.hpp.

int OsiCuts::sizeColCuts ( ) const
inline

Number of column cuts in collection.

Definition at line 376 of file OsiCuts.hpp.

int OsiCuts::sizeCuts ( ) const
inline

Number of cuts in collection.

Definition at line 378 of file OsiCuts.hpp.

void OsiCuts::printCuts ( ) const
inline

Print cuts in collection.

Definition at line 423 of file OsiCuts.hpp.

OsiRowCut * OsiCuts::rowCutPtr ( int  i)
inline

Get pointer to i'th row cut.

Definition at line 386 of file OsiCuts.hpp.

const OsiRowCut * OsiCuts::rowCutPtr ( int  i) const
inline

Get const pointer to i'th row cut.

Definition at line 384 of file OsiCuts.hpp.

OsiColCut * OsiCuts::colCutPtr ( int  i)
inline

Get pointer to i'th column cut.

Definition at line 387 of file OsiCuts.hpp.

const OsiColCut * OsiCuts::colCutPtr ( int  i) const
inline

Get const pointer to i'th column cut.

Definition at line 385 of file OsiCuts.hpp.

OsiRowCut & OsiCuts::rowCut ( int  i)
inline

Get reference to i'th row cut.

Definition at line 391 of file OsiCuts.hpp.

const OsiRowCut & OsiCuts::rowCut ( int  i) const
inline

Get const reference to i'th row cut.

Definition at line 389 of file OsiCuts.hpp.

OsiColCut & OsiCuts::colCut ( int  i)
inline

Get reference to i'th column cut.

Definition at line 392 of file OsiCuts.hpp.

const OsiColCut & OsiCuts::colCut ( int  i) const
inline

Get const reference to i'th column cut.

Definition at line 390 of file OsiCuts.hpp.

const OsiCut * OsiCuts::mostEffectiveCutPtr ( ) const
inline

Get const pointer to the most effective cut.

Definition at line 397 of file OsiCuts.hpp.

OsiCut * OsiCuts::mostEffectiveCutPtr ( )
inline

Get pointer to the most effective cut.

Definition at line 403 of file OsiCuts.hpp.

void OsiCuts::eraseRowCut ( int  i)
inline

Remove i'th row cut from collection.

Definition at line 442 of file OsiCuts.hpp.

void OsiCuts::eraseColCut ( int  i)
inline

Remove i'th column cut from collection.

Definition at line 447 of file OsiCuts.hpp.

OsiRowCut * OsiCuts::rowCutPtrAndZap ( int  i)
inline

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

Definition at line 454 of file OsiCuts.hpp.

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 461 of file OsiCuts.hpp.

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 465 of file OsiCuts.hpp.

void OsiCuts::sort ( )
inline

Cuts with greatest effectiveness are first.

Definition at line 364 of file OsiCuts.hpp.

iterator OsiCuts::begin ( )
inline

Get iterator to beginning of collection.

Definition at line 247 of file OsiCuts.hpp.

const_iterator OsiCuts::begin ( ) const
inline

Get const iterator to beginning of collection.

Definition at line 249 of file OsiCuts.hpp.

iterator OsiCuts::end ( )
inline

Get iterator to end of collection.

Definition at line 251 of file OsiCuts.hpp.

const_iterator OsiCuts::end ( ) const
inline

Get const iterator to end of collection.

Definition at line 253 of file OsiCuts.hpp.

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.

Member Data Documentation

OsiVectorRowCutPtr OsiCuts::rowCutPtrs_
private

Vector of row cuts pointers.

Definition at line 295 of file OsiCuts.hpp.

OsiVectorColCutPtr OsiCuts::colCutPtrs_
private

Vector of column cuts pointers.

Definition at line 297 of file OsiCuts.hpp.


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