25 const std::string & mpsDir);
36 const int * colIndices,
37 const double * lbElements );
45 const int * colIndices,
46 const double * ubElements );
65 using OsiCut::operator== ;
73 using OsiCut::operator!= ;
115 virtual double violated(
const double * solution)
const;
140 virtual void print()
const;
163 const int * colIndices,
164 const double * lbElements )
171 const int * colIndices,
172 const double * ubElements )
207 if ( this->OsiCut::operator!=(rhs) )
220 return !( (*this)==rhs );
260 for ( i=0; i<cutLbs.size(); i++ ) {
261 int colIndx = cutLbs.indices()[i];
263 if ( cutLbs.elements()[i] > oldColLb[colIndx] )
264 newLb = cutLbs.elements()[i];
266 newLb = oldColLb[colIndx];
268 double newUb = oldColUb[colIndx];
269 if ( cutUbs.indexExists(colIndx) )
270 if ( cutUbs[colIndx] < newUb ) newUb = cutUbs[colIndx];
275 for ( i=0; i<cutUbs.size(); i++ ) {
276 int colIndx = cutUbs.indices()[i];
277 double newUb = cutUbs.elements()[i] < oldColUb[colIndx] ? cutUbs.elements()[i] : oldColUb[colIndx];
278 double newLb = oldColLb[colIndx];
279 if ( cutLbs.indexExists(colIndx) )
280 if ( cutLbs[colIndx] > newLb ) newLb = cutLbs[colIndx];
300 double newLb= cutLbs.
getElements()[i] > oldColLb[colIndx] ?
303 double newUb = oldColUb[colIndx];
305 if ( cutUbs[colIndx] < newUb ) newUb = cutUbs[colIndx];
312 double newUb = cutUbs.
getElements()[i] < oldColUb[colIndx] ?
314 double newLb = oldColLb[colIndx];
316 if ( cutLbs[colIndx] > newLb ) newLb = cutLbs[colIndx];
virtual ~OsiColCut()
Destructor.
virtual bool operator!=(const OsiColCut &rhs) const
not equal
void setLbs(int nElements, const int *colIndices, const double *lbElements)
Set column lower bounds.
const CoinPackedVector & lbs() const
Get column lower bounds.
int getMaxIndex() const
Get value of maximum index.
OsiColCut()
Default Constructor.
virtual const int * getIndices() const
Get indices of elements.
virtual const double * getElements() const
Get element values.
void setVector(int size, const int *inds, const double *elems, bool testForDuplicateIndex=COIN_DEFAULT_VALUE_FOR_DUPLICATE)
Set vector size, indices, and elements.
virtual const double * getColUpper() const =0
Get a pointer to an array[getNumCols()] of column upper bounds.
virtual int getNumCols() const =0
Get the number of columns.
virtual OsiColCut * clone() const
Clone.
void setUbs(int nElements, const int *colIndices, const double *ubElements)
Set column upper bounds.
OsiColCut & operator=(const OsiColCut &rhs)
Assignment operator.
virtual double violated(const double *solution) const
Returns infeasibility of the cut with respect to solution passed in i.e.
int getMinIndex() const
Get value of minimum index.
friend void OsiColCutUnitTest(const OsiSolverInterface *baseSiP, const std::string &mpsDir)
A function that tests the methods in the OsiColCut class.
virtual int getNumElements() const
Get the size.
CoinPackedVector ubs_
Upper bounds.
virtual void print() const
Print cuts in collection.
virtual const double * getColLower() const =0
Get a pointer to an array[getNumCols()] of column lower bounds.
bool isExistingIndex(int i) const
Return true if the i'th element of the full storage vector exists in the packed storage vector...
CoinPackedVector lbs_
Lower bounds.
virtual bool operator==(const OsiColCut &rhs) const
equal - true if lower bounds, upper bounds, and OsiCut are equal.
Abstract Base Class for describing an interface to a solver.
const CoinPackedVector & ubs() const
Get column upper bounds.
virtual bool consistent() const
Returns true if the cut is consistent with respect to itself.
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 solve...
void duplicateIndex(const char *methodName=NULL, const char *className=NULL) const
Throw an exception if there are duplicate indices.