Skip to content

Commit a26d56c

Browse files
committed
temporary fix for loop in primal
1 parent ba68364 commit a26d56c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Clp/src/ClpSimplexPrimal.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ int ClpSimplexPrimal::primal(int ifValuesPass, int startFinishOptions)
216216

217217
algorithm_ = +1;
218218
moreSpecialOptions_ &= ~16; // clear check replaceColumn accuracy
219-
219+
int numberInverts=0;int lastInvertIteration=-1;
220220
// save data
221221
ClpDataSave data = saveData();
222222
if (problemStatus_ == 10 && sumPrimalInfeasibilities_ == -123456789.0) {
@@ -362,7 +362,16 @@ int ClpSimplexPrimal::primal(int ifValuesPass, int startFinishOptions)
362362
COIN_DETAIL_PRINT(printf("End small model\n"));
363363
}
364364
}
365-
365+
if (numberIterations_>lastInvertIteration) {
366+
lastInvertIteration=numberIterations_;
367+
numberInverts=0;
368+
} else {
369+
numberInverts++;
370+
if (numberInverts>5) {
371+
//printf("WHAT\n");
372+
cleanStatus();
373+
}
374+
}
366375
// may factorize, checks if problem finished
367376
statusOfProblemInPrimal(lastCleaned, factorType, &progress_, true, ifValuesPass, saveModel);
368377
if (initialStatus == 10) {

0 commit comments

Comments
 (0)