Dip
0.92.4
|
Collections of row cuts and column cuts. More...
#include <OsiCuts.hpp>
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 | |
OsiRowCut * | rowCutPtr (int i) |
Get pointer to i'th row cut. More... | |
const OsiRowCut * | rowCutPtr (int i) const |
Get const pointer to i'th row cut. More... | |
OsiColCut * | colCutPtr (int i) |
Get pointer to i'th column cut. More... | |
const OsiColCut * | colCutPtr (int i) const |
Get const pointer to i'th column cut. More... | |
OsiRowCut & | rowCut (int i) |
Get reference to i'th row cut. More... | |
const OsiRowCut & | rowCut (int i) const |
Get const reference to i'th row cut. More... | |
OsiColCut & | colCut (int i) |
Get reference to i'th column cut. More... | |
const OsiColCut & | colCut (int i) const |
Get const reference to i'th column cut. More... | |
const OsiCut * | mostEffectiveCutPtr () const |
Get const pointer to the most effective cut. More... | |
OsiCut * | mostEffectiveCutPtr () |
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... | |
OsiRowCut * | rowCutPtrAndZap (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... | |
OsiCuts & | operator= (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... | |
Collections of row cuts and column cuts.
Definition at line 19 of file OsiCuts.hpp.
OsiCuts::OsiCuts | ( | ) |
Default constructor.
OsiCuts::OsiCuts | ( | const OsiCuts & | ) |
Copy constructor.
|
virtual |
Destructor.
|
inline |
Insert a row cut.
Definition at line 332 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
|
inline |
Insert a column cut.
Definition at line 338 of file OsiCuts.hpp.
References OsiColCut::clone(), and colCutPtrs_.
|
inline |
Insert a row cut.
The OsiCuts object takes control of the cut object. On return, rcPtr
is NULL.
Definition at line 345 of file OsiCuts.hpp.
References rowCutPtrs_.
|
inline |
Insert a column cut.
The OsiCuts object takes control of the cut object. On return ccPtr
is NULL.
Definition at line 350 of file OsiCuts.hpp.
References colCutPtrs_.
|
inline |
Insert a set of cuts.
Definition at line 373 of file OsiCuts.hpp.
|
inline |
Number of row cuts in collection.
Definition at line 398 of file OsiCuts.hpp.
References rowCutPtrs_.
Referenced by printCuts(), sizeCuts(), and CglStored::sizeRowCuts().
|
inline |
Number of column cuts in collection.
Definition at line 402 of file OsiCuts.hpp.
References colCutPtrs_.
Referenced by printCuts(), and sizeCuts().
|
inline |
Number of cuts in collection.
Definition at line 406 of file OsiCuts.hpp.
References sizeColCuts(), and sizeRowCuts().
|
inline |
Print cuts in collection.
Definition at line 452 of file OsiCuts.hpp.
References colCutPtr(), OsiColCut::print(), OsiRowCut::print(), rowCutPtr(), sizeColCuts(), and sizeRowCuts().
|
inline |
Get pointer to i'th row cut.
Definition at line 416 of file OsiCuts.hpp.
References rowCutPtrs_.
Referenced by printCuts(), rowCut(), and CglStored::rowCutPointer().
|
inline |
Get const pointer to i'th row cut.
Definition at line 414 of file OsiCuts.hpp.
References rowCutPtrs_.
|
inline |
Get pointer to i'th column cut.
Definition at line 417 of file OsiCuts.hpp.
References colCutPtrs_.
Referenced by colCut(), and printCuts().
|
inline |
Get const pointer to i'th column cut.
Definition at line 415 of file OsiCuts.hpp.
References colCutPtrs_.
|
inline |
|
inline |
Get const reference to i'th row cut.
Definition at line 419 of file OsiCuts.hpp.
References rowCutPtr().
|
inline |
Get reference to i'th column cut.
Definition at line 422 of file OsiCuts.hpp.
References colCutPtr().
|
inline |
Get const reference to i'th column cut.
Definition at line 420 of file OsiCuts.hpp.
References colCutPtr().
|
inline |
Get const pointer to the most effective cut.
Definition at line 427 of file OsiCuts.hpp.
|
inline |
Get pointer to the most effective cut.
Definition at line 433 of file OsiCuts.hpp.
References begin(), COIN_DBL_MIN, and end().
|
inline |
Remove i'th row cut from collection.
Definition at line 471 of file OsiCuts.hpp.
References rowCutPtrs_.
|
inline |
Remove i'th column cut from collection.
Definition at line 476 of file OsiCuts.hpp.
References colCutPtrs_.
|
inline |
Get pointer to i'th row cut and remove ptr from collection.
Definition at line 483 of file OsiCuts.hpp.
References rowCutPtrs_.
|
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 490 of file OsiCuts.hpp.
References rowCutPtrs_.
|
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 494 of file OsiCuts.hpp.
References rowCutPtrs_.
|
inline |
Cuts with greatest effectiveness are first.
Definition at line 389 of file OsiCuts.hpp.
References colCutPtrs_, and rowCutPtrs_.
|
inline |
Get iterator to beginning of collection.
Definition at line 255 of file OsiCuts.hpp.
Referenced by insert(), and mostEffectiveCutPtr().
|
inline |
Get const iterator to beginning of collection.
Definition at line 262 of file OsiCuts.hpp.
References OsiCuts::const_iterator::begin().
|
inline |
Get iterator to end of collection.
Definition at line 269 of file OsiCuts.hpp.
References OsiCuts::iterator::end().
Referenced by insert(), and mostEffectiveCutPtr().
|
inline |
Get const iterator to end of collection.
Definition at line 276 of file OsiCuts.hpp.
References OsiCuts::const_iterator::end().
|
private |
Copy internal data.
|
private |
Delete internal data.
|
friend |
A function that tests the methods in the OsiCuts class.
|
private |
Vector of row cuts pointers.
Definition at line 323 of file OsiCuts.hpp.
Referenced by dumpCuts(), eraseAndDumpCuts(), eraseRowCut(), insert(), rowCutPtr(), rowCutPtrAndZap(), sizeRowCuts(), and sort().
|
private |
Vector of column cuts pointers.
Definition at line 325 of file OsiCuts.hpp.
Referenced by colCutPtr(), eraseColCut(), insert(), sizeColCuts(), and sort().