Skip to content

Commit 6ebb8e5

Browse files
committed
Merge remote-tracking branch 'origin/v91-bugfix' into v9-minor
2 parents 59963e1 + 8692b42 commit 6ebb8e5

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ Fixed bugs
9393
- update locks on model variables before removing pseudoboolean constraints in consPresolPseudoboolean()
9494
- skip aggregations on fixed variables in milp presolver to avoid errors for earlier versions of PaPILO
9595
- reformulate soft pseudoboolean constraints with linear constraints if the indicator decomposition is disabled
96+
- in lpi_highs set the presolve option in lpiSolve() to not reset the model status directly after solving the LP
9697

9798
Unit tests
9899
----------

src/lpi/lpi_highs.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ struct SCIP_LPi
180180
int nthreads; /**< number of threads to be used */
181181
SCIP_Bool fromscratch; /**< shall solves be performed from scratch? */
182182
SCIP_Bool solved; /**< was the current LP solved? */
183+
SCIP_Bool presolve; /**< shall the current LP be presolved? */
183184
SCIP_PRICING pricing; /**< SCIP pricing setting */
184185
SCIP_MESSAGEHDLR* messagehdlr; /**< messagehdlr handler for printing messages, or NULL */
185186
};
@@ -452,6 +453,7 @@ SCIP_RETCODE lpiSolve(
452453

453454
lpi->highs->zeroAllClocks();
454455

456+
HIGHS_CALL( lpi->highs->setOptionValue("presolve", lpi->presolve ? "on" : "off") );
455457
/* the optimization result may be reliable even if HiGHS returns a warning status, e.g., HiGHS always returns with a
456458
* warning status if the iteration limit was hit
457459
*/
@@ -503,20 +505,21 @@ SCIP_RETCODE lpiSolve(
503505
/* if basis factorization is unavailable, this may be due to presolving; then solve again without presolve */
504506
HIGHS_CALL( lpi->highs->getOptionValue("presolve", presolvestring) );
505507
assert(presolvestring == "on" || presolvestring == "off"); /* values used in SCIPlpiSetIntpar() */
508+
506509
if( !lpi->highs->hasInvert() && presolvestring == "on" )
507510
{
508511
SCIP_RETCODE retcode;
509512

510513
SCIPdebugMessage("No inverse: running HiGHS again without presolve . . .\n");
511-
HIGHS_CALL( lpi->highs->setOptionValue("presolve", "off") );
514+
lpi->presolve = FALSE;
512515
retcode = lpiSolve(lpi);
513516
if( retcode != SCIP_OKAY )
514517
{
515518
HighsModelStatus model_status2 = lpi->highs->getModelStatus();
516519
SCIPerrorMessage("HiGHS terminated with model status <%s> (%d) after trying to recover inverse\n",
517520
lpi->highs->modelStatusToString(model_status2).c_str(), (int)model_status2);
518521
}
519-
HIGHS_CALL( lpi->highs->setOptionValue("presolve", "on") );
522+
lpi->presolve = TRUE;
520523
SCIP_CALL( retcode );
521524
}
522525

@@ -659,6 +662,7 @@ SCIP_RETCODE SCIPlpiCreate(
659662
(*lpi)->nthreads = 1;
660663
(*lpi)->fromscratch = FALSE;
661664
(*lpi)->solved = FALSE;
665+
(*lpi)->presolve = TRUE;
662666
(*lpi)->pricing = SCIP_PRICING_LPIDEFAULT;
663667
(*lpi)->messagehdlr = messagehdlr;
664668

@@ -2770,12 +2774,7 @@ SCIP_RETCODE SCIPlpiGetIntpar(
27702774
*ival = 2;
27712775
break;
27722776
case SCIP_LPPAR_PRESOLVING:
2773-
{
2774-
std::string presolve;
2775-
HIGHS_CALL( lpi->highs->getOptionValue("presolve", presolve) );
2776-
assert(presolve == "on" || presolve == "off"); /* values used in SCIPlpiSetIntpar() */
2777-
*ival = (presolve == "on");
2778-
}
2777+
*ival = lpi->presolve;
27792778
break;
27802779
case SCIP_LPPAR_PRICING:
27812780
*ival = (int)lpi->pricing; /* store pricing method in LPI struct */
@@ -2832,6 +2831,7 @@ SCIP_RETCODE SCIPlpiSetIntpar(
28322831
break;
28332832
case SCIP_LPPAR_PRESOLVING:
28342833
assert(ival == TRUE || ival == FALSE);
2834+
lpi->presolve = ival;
28352835
HIGHS_CALL( lpi->highs->setOptionValue("presolve", ival ? "on" : "off") );
28362836
break;
28372837
case SCIP_LPPAR_PRICING:

0 commit comments

Comments
 (0)