Skip to content

Commit c4d726e

Browse files
committed
Calc objective in higher precision
1 parent cfd5372 commit c4d726e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

highs/mip/HighsMipSolverData.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,12 +1015,11 @@ void HighsMipSolverData::runSetup() {
10151015
debugSolution.debugSolution.clear();
10161016
debugSolution.debugSolution = postSolveStack.getReducedPrimalSolution(
10171017
debugSolution.debugOrigSolution);
1018-
// Do we even need to recalculate the objective?
10191018
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-
}
1019+
HighsCDouble debugsolobj = 0.0;
1020+
for (HighsInt i = 0; i != mipsolver.model_->num_col_; ++i)
1021+
debugsolobj += mipsolver.colCost(i) * debugSolution.debugSolution[i];
1022+
debugSolution.debugSolObjective = static_cast<double>(debugsolobj);
10241023
debugSolution.registerDomain(domain);
10251024
assert(checkSolution(debugSolution.debugSolution));
10261025
}

0 commit comments

Comments
 (0)