Go to the documentation of this file.
8 #include "CoinPackedVector.hpp"
14 #ifdef OSI_INLINE_ROWCUT_METHODS
15 #define OsiRowCut_inline inline
17 #define OsiRowCut_inline
31 const std::string &mpsDir);
62 const int *colIndices,
63 const double *elements,
76 using OsiCut::operator==;
84 using OsiCut::operator!=;
124 virtual double violated(
const double *solution)
const;
157 row_.sortIncrIndex();
181 int capacity,
int size,
182 int *&colIndices,
double *&elements);
190 virtual void print()
const;
197 CoinPackedVector
row_;
206 #ifdef OSI_INLINE_ROWCUT_METHODS
220 const int *colIndices,
const double *elements)
222 row_.setVector(size, colIndices, elements);
250 if (this->OsiCut::operator!=(
rhs))
254 if (
lb() !=
rhs.lb())
256 if (
ub() !=
rhs.ub())
262 return !((*this) ==
rhs);
270 const CoinPackedVector &r =
row();
271 r.duplicateIndex(
"consistent",
"OsiRowCut");
272 if (r.getMinIndex() < 0)
278 const CoinPackedVector &r =
row();
virtual OsiRowCut * clone() const
Clone.
double rhs() const
Get right-hand side.
void operator/=(double value)
divide every vector entry by value
OsiRowCut_inline bool operator!=(const OsiRowCut &rhs) const
not equal
OsiRowCut & operator=(const OsiRowCut &rhs)
Assignment operator.
OsiRowCut_inline bool infeasible(const OsiSolverInterface &im) const
Returns true if the row cut itself is infeasible and cannot be satisfied.
#define COIN_DEFAULT_VALUE_FOR_DUPLICATE
Base Class for cut.
virtual ~OsiRowCut()
Destructor.
virtual double violated(const double *solution) const
Returns infeasibility of the cut with respect to solution passed in i.e.
void operator+=(double value)
add value to every vector entry
double range() const
Get range (ub - lb for 'R' rows, 0 otherwise)
void operator-=(double value)
subtract value from every vector entry
const OsiRowCut_inline CoinPackedVector & row() const
Get row elements.
virtual void print() const
Print cuts in collection.
OsiRowCut()
Default Constructor.
virtual ~OsiRowCut2()
Destructor.
OsiRowCut_inline void setRow(int size, const int *colIndices, const double *elements, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
Set row elements.
OsiRowCut2 & operator=(const OsiRowCut2 &rhs)
Assignment operator.
OsiRowCut_inline bool operator==(const OsiRowCut &rhs) const
equal - true if lower bound, upper bound, row elements, and OsiCut are equal.
int whichRow() const
Get row.
double lb_
Row lower bound.
void setWhichRow(int row)
Set row.
OsiRowCut2(const OsiRowCut2 &)
Copy constructor.
void sortIncrIndex()
Allow access row sorting function.
void operator*=(double value)
multiply every vector entry by value
OsiRowCut_inline void setLb(double lb)
Set lower bound.
OsiRowCut_inline CoinPackedVector & mutableRow()
Get row elements for changing.
CoinPackedVector row_
Row elements.
OsiRowCut_inline double ub() const
Get upper bound.
OsiRowCut_inline bool consistent() const
Returns true if the cut is consistent.
OsiRowCut_inline double lb() const
Get lower bound.
double ub_
Row upper bound.
virtual OsiRowCut * clone() const
Clone.
OsiRowCut_inline void setUb(double ub)
Set upper bound.
virtual int getNumCols() const =0
Get the number of columns.
char sense() const
Get sense ('E', 'G', 'L', 'N', 'R')
friend void OsiRowCutUnitTest(const OsiSolverInterface *baseSiP, const std::string &mpsDir)
A function that tests the methods in the OsiRowCut class.
Abstract Base Class for describing an interface to a solver.
Row Cut Class which refers back to row which created it.