Go to the documentation of this file.
25 const std::string &mpsDir);
35 const int *colIndices,
36 const double *lbElements);
44 const int *colIndices,
45 const double *ubElements);
64 using OsiCut::operator==;
72 using OsiCut::operator!=;
113 virtual double violated(
const double *solution)
const;
138 virtual void print()
const;
157 const int *colIndices,
158 const double *lbElements)
165 const int *colIndices,
166 const double *ubElements)
200 if (this->OsiCut::operator!=(rhs))
212 return !((*this) == rhs);
256 for ( i=0; i<cutLbs.size(); i++ ) {
257 int colIndx = cutLbs.indices()[i];
259 if ( cutLbs.elements()[i] > oldColLb[colIndx] )
260 newLb = cutLbs.elements()[i];
262 newLb = oldColLb[colIndx];
264 double newUb = oldColUb[colIndx];
265 if ( cutUbs.indexExists(colIndx) )
266 if ( cutUbs[colIndx] < newUb ) newUb = cutUbs[colIndx];
271 for ( i=0; i<cutUbs.size(); i++ ) {
272 int colIndx = cutUbs.indices()[i];
273 double newUb = cutUbs.elements()[i] < oldColUb[colIndx] ? cutUbs.elements()[i] : oldColUb[colIndx];
274 double newLb = oldColLb[colIndx];
275 if ( cutLbs.indexExists(colIndx) )
276 if ( cutLbs[colIndx] > newLb ) newLb = cutLbs[colIndx];
297 double newUb = oldColUb[colIndx];
299 if (cutUbs[colIndx] < newUb)
300 newUb = cutUbs[colIndx];
308 double newLb = oldColLb[colIndx];
310 if (cutLbs[colIndx] > newLb)
311 newLb = cutLbs[colIndx];
virtual bool operator!=(const OsiColCut &rhs) const
not equal
virtual int getNumElements() const
virtual bool infeasible(const OsiSolverInterface &im) const
Returns true if the cut is infeasible with respect to its bounds and the column bounds in the solver ...
void setVector(int size, const int *inds, const double *elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
virtual void print() const
Print cuts in collection.
const CoinPackedVector & lbs() const
Get column lower bounds.
friend void OsiColCutUnitTest(const OsiSolverInterface *baseSiP, const std::string &mpsDir)
A function that tests the methods in the OsiColCut class.
virtual double violated(const double *solution) const
Returns infeasibility of the cut with respect to solution passed in i.e.
CoinPackedVector ubs_
Upper bounds.
void duplicateIndex(const char *methodName=NULL, const char *className=NULL) const
virtual bool consistent() const
Returns true if the cut is consistent with respect to itself.
OsiColCut()
Default Constructor.
OsiColCut & operator=(const OsiColCut &rhs)
Assignment operator.
bool isExistingIndex(int i) const
CoinPackedVector lbs_
Lower bounds.
virtual const double * getElements() const
void setUbs(int nElements, const int *colIndices, const double *ubElements)
Set column upper bounds.
virtual OsiColCut * clone() const
Clone.
virtual bool operator==(const OsiColCut &rhs) const
equal - true if lower bounds, upper bounds, and OsiCut are equal.
virtual const double * getColUpper() const =0
Get a pointer to an array[getNumCols()] of column upper bounds.
void setLbs(int nElements, const int *colIndices, const double *lbElements)
Set column lower bounds.
virtual ~OsiColCut()
Destructor.
virtual const int * getIndices() const
virtual int getNumCols() const =0
Get the number of columns.
Abstract Base Class for describing an interface to a solver.
virtual const double * getColLower() const =0
Get a pointer to an array[getNumCols()] of column lower bounds.
const CoinPackedVector & ubs() const
Get column upper bounds.