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();
305 inline int whichRow()
const double ub_
Row upper bound.
void operator+=(double value)
add value to every vector entry
friend void OsiRowCutUnitTest(const OsiSolverInterface *baseSiP, const std::string &mpsDir)
A function that tests the methods in the OsiRowCut class.
double lb_
Row lower bound.
OsiRowCut_inline const CoinPackedVector & row() const
Get row elements.
double range() const
Get range (ub - lb for 'R' rows, 0 otherwise)
OsiRowCut_inline void setUb(double ub)
Set upper bound.
virtual ~OsiRowCut()
Destructor.
OsiRowCut & operator=(const OsiRowCut &rhs)
Assignment operator.
OsiRowCut_inline bool consistent() const
Returns true if the cut is consistent.
virtual int getNumCols() const =0
Get the number of columns.
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.
Abstract Base Class for describing an interface to a solver.
Row Cut Class which refers back to row which created it.
OsiRowCut_inline bool operator!=(const OsiRowCut &rhs) const
not equal
OsiRowCut_inline double ub() const
Get upper bound.
virtual OsiRowCut * clone() const
Clone.
virtual void print() const
Print cuts in collection.
OsiRowCut_inline CoinPackedVector & mutableRow()
Get row elements for changing.
void operator-=(double value)
subtract value from every vector entry
void operator/=(double value)
divide every vector entry by value
OsiRowCut_inline void setRow(int size, const int *colIndices, const double *elements, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
Set row elements.
virtual double violated(const double *solution) const
Returns infeasibility of the cut with respect to solution passed in i.e.
double rhs() const
Get right-hand side.
OsiRowCut()
Default Constructor.
void operator*=(double value)
multiply every vector entry by value
OsiRowCut_inline double lb() const
Get lower bound.
void sortIncrIndex()
Allow access row sorting function.
char sense() const
Get sense ('E', 'G', 'L', 'N', 'R')
OsiRowCut_inline bool operator==(const OsiRowCut &rhs) const
equal - true if lower bound, upper bound, row elements, and OsiCut are equal.
OsiRowCut_inline void setLb(double lb)
Set lower bound.
CoinPackedVector row_
Row elements.
void setWhichRow(int row)
Set row.