@@ -694,10 +694,6 @@ void HighsMipSolverData::init() {
694694}
695695
696696void HighsMipSolverData::runPresolve (const HighsInt presolve_reduction_limit) {
697- #ifdef HIGHS_DEBUGSOL
698- bool debugSolActive = false ;
699- std::swap (debugSolution.debugSolActive , debugSolActive);
700- #endif
701697
702698 mipsolver.timer_ .start (mipsolver.timer_ .presolve_clock );
703699 presolve::HPresolve presolve;
@@ -709,13 +705,6 @@ void HighsMipSolverData::runPresolve(const HighsInt presolve_reduction_limit) {
709705 presolve_status = presolve.getPresolveStatus ();
710706 }
711707 mipsolver.timer_ .stop (mipsolver.timer_ .presolve_clock );
712-
713- #ifdef HIGHS_DEBUGSOL
714- debugSolution.debugSolActive = debugSolActive;
715- if (debugSolution.debugSolActive ) debugSolution.registerDomain (domain);
716- assert (!debugSolution.debugSolActive ||
717- checkSolution (debugSolution.debugSolution ));
718- #endif
719708}
720709
721710void HighsMipSolverData::runSetup () {
@@ -1022,10 +1011,18 @@ void HighsMipSolverData::runSetup() {
10221011 heuristics.setupIntCols ();
10231012
10241013#ifdef HIGHS_DEBUGSOL
1025- if (numRestarts == 0 ) {
1026- debugSolution.activate ();
1027- assert (!debugSolution.debugSolActive ||
1028- checkSolution (debugSolution.debugSolution ));
1014+ if (debugSolution.debugSolActive ) {
1015+ debugSolution.debugSolution .clear ();
1016+ debugSolution.debugSolution = postSolveStack.getReducedPrimalSolution (
1017+ debugSolution.debugOrigSolution );
1018+ // Do we even need to recalculate the objective?
1019+ debugSolution.debugSolObjective = 0 ;
1020+ for (HighsInt i = 0 ; i != mipsolver.model_ ->num_col_ ; ++i) {
1021+ debugSolution.debugSolObjective +=
1022+ mipsolver.colCost (i) * debugSolution.debugSolution [i];
1023+ }
1024+ debugSolution.registerDomain (domain);
1025+ assert (checkSolution (debugSolution.debugSolution ));
10291026 }
10301027#endif
10311028
@@ -1218,6 +1215,10 @@ void HighsMipSolverData::performRestart() {
12181215 presolvedModel = lp.getLp ();
12191216 presolvedModel.offset_ = offset;
12201217 presolvedModel.integrality_ = std::move (integrality);
1218+ #ifdef HIGHS_DEBUGSOL
1219+ bool debugSolActive = false ;
1220+ std::swap (debugSolution.debugSolActive , debugSolActive);
1221+ #endif
12211222
12221223 const HighsBasis& basis = firstrootbasis;
12231224 if (basis.valid ) {
@@ -1321,6 +1322,9 @@ void HighsMipSolverData::performRestart() {
13211322 }
13221323 // Bounds are currently in the original space since presolve will have
13231324 // changed offset_
1325+ #ifdef HIGHS_DEBUGSOL
1326+ debugSolution.debugSolActive = debugSolActive;
1327+ #endif
13241328 runSetup ();
13251329
13261330 postSolveStack.removeCutsFromModel (numCuts);
0 commit comments