8 #include "CoinPackedVector.hpp" 14 #ifdef OSI_INLINE_ROWCUT_METHODS 15 #define OsiRowCut_inline inline 17 #define OsiRowCut_inline 31 const std::string & mpsDir);
63 const int * colIndices,
64 const double * elements,
77 using OsiCut::operator== ;
85 using OsiCut::operator!= ;
126 virtual double violated(
const double * solution)
const;
150 {
row_.sortIncrIndex();}
173 int capacity,
int size,
174 int *&colIndices,
double *&elements);
182 virtual void print()
const ;
191 CoinPackedVector
row_;
200 #ifdef OSI_INLINE_ROWCUT_METHODS 214 const int * colIndices,
const double * elements)
216 row_.setVector(size,colIndices,elements);
245 if ( this->OsiCut::operator!=(rhs) )
return false;
246 if (
row() != rhs.
row() )
return false;
247 if (
lb() != rhs.
lb() )
return false;
248 if (
ub() != rhs.
ub() )
return false;
254 return !( (*this)==
rhs );
263 const CoinPackedVector & r=
row();
264 r.duplicateIndex(
"consistent",
"OsiRowCut");
265 if ( r.getMinIndex() < 0 )
return false;
270 const CoinPackedVector & r=
row();
271 if ( r.getMaxIndex() >= im.
getNumCols() )
return false;
277 if (
lb() >
ub() )
return true;
296 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.
OsiRowCut_inline bool operator!=(const OsiRowCut &rhs) const
not equal
double lb_
Row lower bound.
OsiRowCut_inline double lb() const
Get lower bound.
virtual int getNumCols() const =0
Get the number of columns.
double rhs() const
Get right-hand side.
OsiRowCut_inline void setUb(double ub)
Set upper bound.
virtual ~OsiRowCut()
Destructor.
OsiRowCut & operator=(const OsiRowCut &rhs)
Assignment operator.
virtual OsiRowCut * clone() const
Clone.
virtual void print() const
Print cuts in collection.
#define COIN_DEFAULT_VALUE_FOR_DUPLICATE
Base Class for cut.
Abstract Base Class for describing an interface to a solver.
double range() const
Get range (ub - lb for 'R' rows, 0 otherwise)
Row Cut Class which refers back to row which created it.
OsiRowCut_inline double ub() const
Get upper bound.
OsiRowCut_inline const CoinPackedVector & row() const
Get row elements.
char sense() const
Get sense ('E', 'G', 'L', 'N', 'R')
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.
OsiRowCut_inline bool infeasible(const OsiSolverInterface &im) const
Returns true if the row cut itself is infeasible and cannot be satisfied.
virtual double violated(const double *solution) const
Returns infeasibility of the cut with respect to solution passed in i.e.
OsiRowCut()
Default Constructor.
void operator*=(double value)
multiply every vector entry by value
void sortIncrIndex()
Allow access row sorting function.
OsiRowCut_inline bool consistent() const
Returns true if the cut is consistent.
OsiRowCut_inline void setLb(double lb)
Set lower bound.
CoinPackedVector row_
Row elements.
OsiRowCut_inline bool operator==(const OsiRowCut &rhs) const
equal - true if lower bound, upper bound, row elements, and OsiCut are equal.
void setWhichRow(int row)
Set row.