Skip to content

Commit

Permalink
take out freed up rows when indicators
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhforrest committed Sep 25, 2022
1 parent cfd95c7 commit 80a9927
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/ClpModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3696,7 +3696,7 @@ ClpModel::modifyByIndicators(CoinMpsIO &m, double startBigM,
#if DETAIL
char temp[50];
sprintf(temp,"/tmp/tryind%d.mps",iTry+1);
model.writeMps(temp);
model.writeMps(temp,2,1);
#endif
// replace matrix and rhs
memcpy(rowLower_,rowLower,numberRows_*sizeof(double));
Expand All @@ -3708,7 +3708,22 @@ ClpModel::modifyByIndicators(CoinMpsIO &m, double startBigM,
model.setObjectiveOffset(saveOffset);
model.setDualObjectiveLimit(saveCutoff);
model.setOptimizationDirection(saveDirection);

*this = model;
eventHandler_->setSimplex(static_cast<ClpSimplex *>(this));
// delete freed up rows
int nDelete = 0;
for (int i=0;i<numberRows_;i++) {
if (rowLower_[i]<-1.0e30 && rowUpper_[i]>1.0e30) {
whichRow[nDelete++] = i;
//printf("deleting row %d (%s) rhs %g %g\n",
// i,rowName(i).c_str(),
// rowLower_[i],rowUpper_[i]);
}
}
deleteRows(nDelete,whichRow);
#if DETAIL
writeMps("/tmp/end.mps",2,1);
#endif
delete [] saveObjective;
delete [] newValues;
delete [] whichRow;
Expand Down

0 comments on commit 80a9927

Please sign in to comment.