//------------------------------------------------------------------- void OsiCuts::gutsOfCopy(const OsiCuts& source) { assert( sizeRowCuts()==0 ); assert( sizeColCuts()==0 ); assert( sizeCuts()==0 ); int i; int ne = source.sizeRowCuts(); for (i=0; i<ne; i++) insert( source.rowCut(i) ); ne = source.sizeColCuts(); for (i=0; i<ne; i++) insert( source.colCut(i) ); }
//---------------------------------------------------------------- // Print all cuts //---------------------------------------------------------------- void OsiCuts::printCuts() const { // do all column cuts first int i; int numberColCuts=sizeColCuts(); for (i=0;i<numberColCuts;i++) { const OsiColCut * cut = colCutPtr(i); cut->print(); } int numberRowCuts=sizeRowCuts(); for (i=0;i<numberRowCuts;i++) { const OsiRowCut * cut = rowCutPtr(i); cut->print(); } }
//------------------------------------------------------------------- void OsiCuts::gutsOfDestructor() { int i; int ne = rowCutPtrs_.size(); for (i=0; i<ne; i++) { if (rowCutPtrs_[i]->globallyValidAsInteger()!=2) delete rowCutPtrs_[i]; } rowCutPtrs_.clear(); ne = colCutPtrs_.size(); for (i=0; i<ne; i++) { if (colCutPtrs_[i]->globallyValidAsInteger()!=2) delete colCutPtrs_[i]; } colCutPtrs_.clear(); assert( sizeRowCuts()==0 ); assert( sizeColCuts()==0 ); assert( sizeCuts() ==0 ); }
int OsiCuts::sizeCuts() const { return static_cast<int>(sizeRowCuts()+sizeColCuts()); }