#include <OsiCut.hpp>
Inheritance diagram for OsiCut:
Public Member Functions | |
Effectiveness | |
void | setEffectiveness (double e) |
Set effectiveness. | |
double | effectiveness () const |
Get effectiveness. | |
GloballyValid | |
void | setGloballyValid (bool trueFalse) |
Set globallyValid (nonzero true). | |
void | setGloballyValid () |
Set globallyValid (nonzero true). | |
void | setNotGloballyValid () |
Set globallyValid (nonzero true). | |
bool | globallyValid () const |
Get globallyValid. | |
void | setGloballyValidAsInteger (int trueFalse) |
Set globallyValid as integer (nonzero true). | |
int | globallyValidAsInteger () const |
Get globallyValid. | |
Debug stuff | |
virtual void | print () const |
Print cuts in collection. | |
Comparison operators | |
virtual bool | operator== (const OsiCut &rhs) const |
equal. 2 cuts are equal if there effectiveness are equal | |
virtual bool | operator!= (const OsiCut &rhs) const |
not equal | |
virtual bool | operator< (const OsiCut &rhs) const |
less than. True if this.effectiveness < rhs.effectiveness | |
virtual bool | operator> (const OsiCut &rhs) const |
less than. True if this.effectiveness > rhs.effectiveness | |
Sanity checks on cut | |
virtual bool | consistent () const =0 |
Returns true if the cut is consistent with respect to itself, without considering any data in the model. | |
virtual bool | consistent (const OsiSolverInterface &si) const =0 |
Returns true if cut is consistent when considering the solver interface's model. | |
virtual bool | infeasible (const OsiSolverInterface &si) const =0 |
Returns true if the cut is infeasible "with respect to itself" and cannot be satisfied. | |
virtual double | violated (const double *solution) const =0 |
Returns infeasibility of the cut with respect to solution passed in i.e. | |
Effectiveness | |
void | setEffectiveness (double e) |
Set effectiveness. | |
double | effectiveness () const |
Get effectiveness. | |
GloballyValid | |
void | setGloballyValid (bool trueFalse) |
Set globallyValid (nonzero true). | |
void | setGloballyValid () |
Set globallyValid (nonzero true). | |
void | setNotGloballyValid () |
Set globallyValid (nonzero true). | |
bool | globallyValid () const |
Get globallyValid. | |
void | setGloballyValidAsInteger (int trueFalse) |
Set globallyValid as integer (nonzero true). | |
int | globallyValidAsInteger () const |
Get globallyValid. | |
Debug stuff | |
virtual void | print () const |
Print cuts in collection. | |
Comparison operators | |
virtual bool | operator== (const OsiCut &rhs) const |
equal. 2 cuts are equal if there effectiveness are equal | |
virtual bool | operator!= (const OsiCut &rhs) const |
not equal | |
virtual bool | operator< (const OsiCut &rhs) const |
less than. True if this.effectiveness < rhs.effectiveness | |
virtual bool | operator> (const OsiCut &rhs) const |
less than. True if this.effectiveness > rhs.effectiveness | |
Sanity checks on cut | |
virtual bool | consistent () const =0 |
Returns true if the cut is consistent with respect to itself, without considering any data in the model. | |
virtual bool | consistent (const OsiSolverInterface &si) const =0 |
Returns true if cut is consistent when considering the solver interface's model. | |
virtual bool | infeasible (const OsiSolverInterface &si) const =0 |
Returns true if the cut is infeasible "with respect to itself" and cannot be satisfied. | |
virtual double | violated (const double *solution) const =0 |
Returns infeasibility of the cut with respect to solution passed in i.e. | |
Protected Member Functions | |
Constructors and destructors | |
OsiCut () | |
Default Constructor. | |
OsiCut (const OsiCut &) | |
Copy constructor. | |
OsiCut & | operator= (const OsiCut &rhs) |
Assignment operator. | |
virtual | ~OsiCut () |
Destructor. | |
Constructors and destructors | |
OsiCut () | |
Default Constructor. | |
OsiCut (const OsiCut &) | |
Copy constructor. | |
OsiCut & | operator= (const OsiCut &rhs) |
Assignment operator. | |
virtual | ~OsiCut () |
Destructor. | |
Private Attributes | |
Private member data | |
double | effectiveness_ |
Effectiveness. | |
int | globallyValid_ |
If cut has global validity i.e. can be used anywhere in tree. |
The Base cut class contains:
Definition at line 23 of file OsiCut.hpp.
OsiCut::OsiCut | ( | ) | [protected] |
Default Constructor.
OsiCut::OsiCut | ( | const OsiCut & | ) | [protected] |
Copy constructor.
virtual OsiCut::~OsiCut | ( | ) | [protected, virtual] |
Destructor.
OsiCut::OsiCut | ( | ) | [protected] |
Default Constructor.
OsiCut::OsiCut | ( | const OsiCut & | ) | [protected] |
Copy constructor.
virtual OsiCut::~OsiCut | ( | ) | [protected, virtual] |
Destructor.
void OsiCut::setEffectiveness | ( | double | e | ) | [inline] |
double OsiCut::effectiveness | ( | ) | const [inline] |
Get effectiveness.
Definition at line 197 of file OsiCut.hpp.
References effectiveness_.
Referenced by OsiCuts::OsiCutCompare::operator()(), operator<(), operator==(), and operator>().
void OsiCut::setGloballyValid | ( | bool | trueFalse | ) | [inline] |
Set globallyValid (nonzero true).
Definition at line 39 of file OsiCut.hpp.
References globallyValid_.
void OsiCut::setGloballyValid | ( | ) | [inline] |
Set globallyValid (nonzero true).
Definition at line 41 of file OsiCut.hpp.
References globallyValid_.
void OsiCut::setNotGloballyValid | ( | ) | [inline] |
Set globallyValid (nonzero true).
Definition at line 43 of file OsiCut.hpp.
References globallyValid_.
bool OsiCut::globallyValid | ( | ) | const [inline] |
void OsiCut::setGloballyValidAsInteger | ( | int | trueFalse | ) | [inline] |
Set globallyValid as integer (nonzero true).
Definition at line 49 of file OsiCut.hpp.
References globallyValid_.
int OsiCut::globallyValidAsInteger | ( | ) | const [inline] |
virtual void OsiCut::print | ( | ) | const [inline, virtual] |
equal. 2 cuts are equal if there effectiveness are equal
Definition at line 213 of file OsiCut.hpp.
References effectiveness().
less than. True if this.effectiveness < rhs.effectiveness
Definition at line 223 of file OsiCut.hpp.
References effectiveness().
less than. True if this.effectiveness > rhs.effectiveness
Definition at line 228 of file OsiCut.hpp.
References effectiveness().
virtual bool OsiCut::consistent | ( | ) | const [inline, pure virtual] |
virtual bool OsiCut::consistent | ( | const OsiSolverInterface & | si | ) | const [inline, pure virtual] |
Returns true if cut is consistent when considering the solver interface's model.
For example, it might check to ensure that a column index is not greater than the number of columns in the model. Assumes consistent() is true.
Implemented in OsiColCut, OsiRowCut, OsiColCut, and OsiRowCut.
virtual bool OsiCut::infeasible | ( | const OsiSolverInterface & | si | ) | const [inline, pure virtual] |
Returns true if the cut is infeasible "with respect to itself" and cannot be satisfied.
This method does NOT check whether adding the cut to the solver interface's model will make the -model- infeasble. A cut which returns !infeasible(si) may very well make the model infeasible. (Of course, adding a cut with returns infeasible(si) will make the model infeasible.)
The "with respect to itself" is in quotes becaues in the case where the cut simply replaces existing bounds, it may make sense to test infeasibility with respect to the current bounds held in the solver interface's model. For example, if the cut has a single variable in it, it might check that the maximum of new and existing lower bounds is greater than the minium of the new and existing upper bounds.
Assumes that consistent(si) is true.
Infeasible cuts can be a useful mechanism for a cut generator to inform the solver interface that its detected infeasibility of the problem.
Implemented in OsiColCut, OsiRowCut, OsiColCut, and OsiRowCut.
virtual double OsiCut::violated | ( | const double * | solution | ) | const [pure virtual] |
void OsiCut::setEffectiveness | ( | double | e | ) | [inline] |
Set effectiveness.
double OsiCut::effectiveness | ( | ) | const [inline] |
Get effectiveness.
void OsiCut::setGloballyValid | ( | bool | trueFalse | ) | [inline] |
Set globallyValid (nonzero true).
Definition at line 39 of file OsiCut.hpp.
References globallyValid_.
void OsiCut::setGloballyValid | ( | ) | [inline] |
Set globallyValid (nonzero true).
Definition at line 41 of file OsiCut.hpp.
References globallyValid_.
void OsiCut::setNotGloballyValid | ( | ) | [inline] |
Set globallyValid (nonzero true).
Definition at line 43 of file OsiCut.hpp.
References globallyValid_.
bool OsiCut::globallyValid | ( | ) | const [inline] |
void OsiCut::setGloballyValidAsInteger | ( | int | trueFalse | ) | [inline] |
Set globallyValid as integer (nonzero true).
Definition at line 49 of file OsiCut.hpp.
References globallyValid_.
int OsiCut::globallyValidAsInteger | ( | ) | const [inline] |
virtual void OsiCut::print | ( | ) | const [inline, virtual] |
equal. 2 cuts are equal if there effectiveness are equal
less than. True if this.effectiveness < rhs.effectiveness
less than. True if this.effectiveness > rhs.effectiveness
virtual bool OsiCut::consistent | ( | ) | const [inline, pure virtual] |
virtual bool OsiCut::consistent | ( | const OsiSolverInterface & | si | ) | const [inline, pure virtual] |
Returns true if cut is consistent when considering the solver interface's model.
For example, it might check to ensure that a column index is not greater than the number of columns in the model. Assumes consistent() is true.
Implemented in OsiColCut, OsiRowCut, OsiColCut, and OsiRowCut.
virtual bool OsiCut::infeasible | ( | const OsiSolverInterface & | si | ) | const [inline, pure virtual] |
Returns true if the cut is infeasible "with respect to itself" and cannot be satisfied.
This method does NOT check whether adding the cut to the solver interface's model will make the -model- infeasble. A cut which returns !infeasible(si) may very well make the model infeasible. (Of course, adding a cut with returns infeasible(si) will make the model infeasible.)
The "with respect to itself" is in quotes becaues in the case where the cut simply replaces existing bounds, it may make sense to test infeasibility with respect to the current bounds held in the solver interface's model. For example, if the cut has a single variable in it, it might check that the maximum of new and existing lower bounds is greater than the minium of the new and existing upper bounds.
Assumes that consistent(si) is true.
Infeasible cuts can be a useful mechanism for a cut generator to inform the solver interface that its detected infeasibility of the problem.
Implemented in OsiColCut, OsiRowCut, OsiColCut, and OsiRowCut.
virtual double OsiCut::violated | ( | const double * | solution | ) | const [pure virtual] |
double OsiCut::effectiveness_ [private] |
Effectiveness.
Definition at line 180 of file OsiCut.hpp.
Referenced by effectiveness(), and setEffectiveness().
int OsiCut::globallyValid_ [private] |
If cut has global validity i.e. can be used anywhere in tree.
Definition at line 182 of file OsiCut.hpp.
Referenced by globallyValid(), globallyValidAsInteger(), setGloballyValid(), setGloballyValidAsInteger(), and setNotGloballyValid().