Row Cut Class. More...
#include <OsiRowCut.hpp>
Public Member Functions | |
void | sortIncrIndex () |
Allow access row sorting function. More... | |
Row bounds | |
OsiRowCut_inline double | lb () const |
Get lower bound. More... | |
OsiRowCut_inline void | setLb (double lb) |
Set lower bound. More... | |
OsiRowCut_inline double | ub () const |
Get upper bound. More... | |
OsiRowCut_inline void | setUb (double ub) |
Set upper bound. More... | |
Row rhs, sense, range | |
char | sense () const |
Get sense ('E', 'G', 'L', 'N', 'R') More... | |
double | rhs () const |
Get right-hand side. More... | |
double | range () const |
Get range (ub - lb for 'R' rows, 0 otherwise) More... | |
Row elements | |
OsiRowCut_inline void | setRow (int size, const int *colIndices, const double *elements, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE) |
Set row elements. More... | |
OsiRowCut_inline void | setRow (const CoinPackedVector &v) |
Set row elements from a packed vector. More... | |
OsiRowCut_inline const CoinPackedVector & | row () const |
Get row elements. More... | |
OsiRowCut_inline CoinPackedVector & | mutableRow () |
Get row elements for changing. More... | |
Comparison operators | |
OsiRowCut_inline bool | operator== (const OsiRowCut &rhs) const |
equal - true if lower bound, upper bound, row elements, and OsiCut are equal. More... | |
OsiRowCut_inline bool | operator!= (const OsiRowCut &rhs) const |
not equal More... | |
Sanity checks on cut | |
OsiRowCut_inline bool | consistent () const |
Returns true if the cut is consistent. More... | |
OsiRowCut_inline bool | consistent (const OsiSolverInterface &im) const |
Returns true if cut is consistent with respect to the solver interface's model. More... | |
OsiRowCut_inline bool | infeasible (const OsiSolverInterface &im) const |
Returns true if the row cut itself is infeasible and cannot be satisfied. More... | |
virtual double | violated (const double *solution) const |
Returns infeasibility of the cut with respect to solution passed in i.e. More... | |
Arithmetic operators. Apply CoinPackedVector methods to the vector | |
void | operator+= (double value) |
add value to every vector entry More... | |
void | operator-= (double value) |
subtract value from every vector entry More... | |
void | operator*= (double value) |
multiply every vector entry by value More... | |
void | operator/= (double value) |
divide every vector entry by value More... | |
Constructors and destructors | |
OsiRowCut & | operator= (const OsiRowCut &rhs) |
Assignment operator. More... | |
OsiRowCut (const OsiRowCut &) | |
Copy constructor. More... | |
virtual OsiRowCut * | clone () const |
Clone. More... | |
OsiRowCut () | |
Default Constructor. More... | |
OsiRowCut (double cutlb, double cutub, int capacity, int size, int *&colIndices, double *&elements) | |
Ownership Constructor. More... | |
virtual | ~OsiRowCut () |
Destructor. More... | |
Debug stuff | |
virtual void | print () const |
Print cuts in collection. More... | |
![]() | |
void | setEffectiveness (double e) |
Set effectiveness. More... | |
double | effectiveness () const |
Get effectiveness. More... | |
void | setGloballyValid (bool trueFalse) |
Set globallyValid (nonzero true) More... | |
void | setGloballyValid () |
Set globallyValid (nonzero true) More... | |
void | setNotGloballyValid () |
Set globallyValid (nonzero true) More... | |
bool | globallyValid () const |
Get globallyValid. More... | |
void | setGloballyValidAsInteger (int trueFalse) |
Set globallyValid as integer (nonzero true) More... | |
int | globallyValidAsInteger () const |
Get globallyValid. More... | |
virtual bool | operator== (const OsiCut &rhs) const |
equal. 2 cuts are equal if there effectiveness are equal More... | |
virtual bool | operator!= (const OsiCut &rhs) const |
not equal More... | |
virtual bool | operator< (const OsiCut &rhs) const |
less than. True if this.effectiveness < rhs.effectiveness More... | |
virtual bool | operator> (const OsiCut &rhs) const |
less than. True if this.effectiveness > rhs.effectiveness More... | |
Private Attributes | |
Private member data | |
CoinPackedVector | row_ |
Row elements. More... | |
double | lb_ |
Row lower bound. More... | |
double | ub_ |
Row upper bound. More... | |
Friends | |
void | OsiRowCutUnitTest (const OsiSolverInterface *baseSiP, const std::string &mpsDir) |
A function that tests the methods in the OsiRowCut class. More... | |
Additional Inherited Members | |
![]() | |
OsiCut () | |
Default Constructor. More... | |
OsiCut (const OsiCut &) | |
Copy constructor. More... | |
OsiCut & | operator= (const OsiCut &rhs) |
Assignment operator. More... | |
virtual | ~OsiCut () |
Destructor. More... | |
Row Cut Class.
A row cut has:
Definition at line 29 of file OsiRowCut.hpp.
OsiRowCut::OsiRowCut | ( | const OsiRowCut & | ) |
Copy constructor.
OsiRowCut::OsiRowCut | ( | ) |
Default Constructor.
OsiRowCut::OsiRowCut | ( | double | cutlb, |
double | cutub, | ||
int | capacity, | ||
int | size, | ||
int *& | colIndices, | ||
double *& | elements | ||
) |
Ownership Constructor.
This constructor assumes ownership of the vectors passed as parameters for indices and elements. colIndices
and elements
will be NULL on return.
|
virtual |
Destructor.
OsiRowCut_inline double OsiRowCut::lb | ( | ) | const |
Get lower bound.
OsiRowCut_inline void OsiRowCut::setLb | ( | double | lb | ) |
Set lower bound.
OsiRowCut_inline double OsiRowCut::ub | ( | ) | const |
Get upper bound.
OsiRowCut_inline void OsiRowCut::setUb | ( | double | ub | ) |
Set upper bound.
char OsiRowCut::sense | ( | ) | const |
Get sense ('E', 'G', 'L', 'N', 'R')
double OsiRowCut::rhs | ( | ) | const |
Get right-hand side.
double OsiRowCut::range | ( | ) | const |
Get range (ub - lb for 'R' rows, 0 otherwise)
OsiRowCut_inline void OsiRowCut::setRow | ( | int | size, |
const int * | colIndices, | ||
const double * | elements, | ||
bool | testForDuplicateIndex = COIN_DEFAULT_VALUE_FOR_DUPLICATE |
||
) |
Set row elements.
OsiRowCut_inline void OsiRowCut::setRow | ( | const CoinPackedVector & | v | ) |
Set row elements from a packed vector.
OsiRowCut_inline const CoinPackedVector& OsiRowCut::row | ( | ) | const |
Get row elements.
OsiRowCut_inline CoinPackedVector& OsiRowCut::mutableRow | ( | ) |
Get row elements for changing.
OsiRowCut_inline bool OsiRowCut::operator== | ( | const OsiRowCut & | rhs | ) | const |
equal - true if lower bound, upper bound, row elements, and OsiCut are equal.
OsiRowCut_inline bool OsiRowCut::operator!= | ( | const OsiRowCut & | rhs | ) | const |
not equal
|
virtual |
Returns true if the cut is consistent.
This checks to ensure that:
Implements OsiCut.
|
virtual |
Returns true if cut is consistent with respect to the solver interface's model.
This checks to ensure that
Implements OsiCut.
|
virtual |
Returns true if the row cut itself is infeasible and cannot be satisfied.
This checks whether
Implements OsiCut.
|
virtual |
Returns infeasibility of the cut with respect to solution passed in i.e.
is positive if cuts off that solution. solution is getNumCols() long..
Implements OsiCut.
|
inline |
add value
to every vector entry
Definition at line 132 of file OsiRowCut.hpp.
|
inline |
subtract value
from every vector entry
Definition at line 136 of file OsiRowCut.hpp.
|
inline |
multiply every vector entry by value
Definition at line 140 of file OsiRowCut.hpp.
|
inline |
divide every vector entry by value
Definition at line 144 of file OsiRowCut.hpp.
|
inline |
Allow access row sorting function.
Definition at line 149 of file OsiRowCut.hpp.
|
virtual |
Clone.
Reimplemented in OsiRowCut2.
|
virtual |
Print cuts in collection.
Reimplemented from OsiCut.
|
friend |
A function that tests the methods in the OsiRowCut class.
|
private |
Row elements.
Definition at line 192 of file OsiRowCut.hpp.
|
private |
Row lower bound.
Definition at line 194 of file OsiRowCut.hpp.
|
private |
Row upper bound.
Definition at line 196 of file OsiRowCut.hpp.