10 #include "CoinPackedVector.hpp"
25 const std::string &mpsDir);
35 const int *colIndices,
36 const double *lbElements);
39 inline void setLbs(
const CoinPackedVector &
lbs);
44 const int *colIndices,
45 const double *ubElements);
48 inline void setUbs(
const CoinPackedVector &
ubs);
55 inline const CoinPackedVector &
lbs()
const;
58 inline const CoinPackedVector &
ubs()
const;
64 using OsiCut::operator==;
72 using OsiCut::operator!=;
113 virtual double violated(
const double *solution)
const;
138 virtual void print()
const;
145 CoinPackedVector
lbs_;
157 const int *colIndices,
158 const double *lbElements)
160 lbs_.setVector(size, colIndices, lbElements);
165 const int *colIndices,
166 const double *ubElements)
168 ubs_.setVector(size, colIndices, ubElements);
200 if (this->OsiCut::operator!=(rhs))
212 return !((*this) == rhs);
220 const CoinPackedVector &lb =
lbs();
221 const CoinPackedVector &ub =
ubs();
224 lb.duplicateIndex(
"consistent",
"OsiColCut");
225 ub.duplicateIndex(
"consistent",
"OsiColCut");
226 if (lb.getMinIndex() < 0)
228 if (ub.getMinIndex() < 0)
235 const CoinPackedVector &lb =
lbs();
236 const CoinPackedVector &ub =
ubs();
252 const CoinPackedVector & cutLbs =
lbs();
253 const CoinPackedVector & cutUbs =
ubs();
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];
289 const CoinPackedVector &cutLbs =
lbs();
290 const CoinPackedVector &cutUbs =
ubs();
293 for (i = 0; i < cutLbs.getNumElements(); i++) {
294 int colIndx = cutLbs.getIndices()[i];
295 double newLb = cutLbs.getElements()[i] > oldColLb[colIndx] ? cutLbs.getElements()[i] : oldColLb[colIndx];
297 double newUb = oldColUb[colIndx];
298 if (cutUbs.isExistingIndex(colIndx))
299 if (cutUbs[colIndx] < newUb)
300 newUb = cutUbs[colIndx];
305 for (i = 0; i < cutUbs.getNumElements(); i++) {
306 int colIndx = cutUbs.getIndices()[i];
307 double newUb = cutUbs.getElements()[i] < oldColUb[colIndx] ? cutUbs.getElements()[i] : oldColUb[colIndx];
308 double newLb = oldColLb[colIndx];
309 if (cutLbs.isExistingIndex(colIndx))
310 if (cutLbs[colIndx] > newLb)
311 newLb = cutLbs[colIndx];