Skip to content

Commit d5ff107

Browse files
committed
Add HighsCDouble to obj calc
1 parent 32e88dd commit d5ff107

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

highs/mip/HighsDebugSol.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ void HighsDebugSol::activate() {
5252
if (line.find("# Rows") != std::string::npos) {
5353
break;
5454
}
55-
if (!incolsection)
56-
continue;
55+
if (!incolsection) continue;
5756

5857
std::istringstream linestream(line);
5958
linestream >> varname;
@@ -70,8 +69,8 @@ void HighsDebugSol::activate() {
7069

7170
HighsCDouble debugsolobj = 0.0;
7271
for (HighsInt i = 0; i != mipsolver->orig_model_->num_col_; ++i)
73-
debugsolobj +=
74-
mipsolver->orig_model_->col_cost_[i] * debugOrigSolution[i];
72+
debugsolobj += mipsolver->orig_model_->col_cost_[i] *
73+
HighsCDouble(debugOrigSolution[i]);
7574

7675
debugSolObjective = double(debugsolobj + mipsolver->orig_model_->offset_);
7776
debugSolActive = true;

highs/mip/HighsMipSolverData.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,6 @@ void HighsMipSolverData::init() {
694694
}
695695

696696
void HighsMipSolverData::runPresolve(const HighsInt presolve_reduction_limit) {
697-
698697
mipsolver.timer_.start(mipsolver.timer_.presolve_clock);
699698
presolve::HPresolve presolve;
700699
if (!presolve.okSetInput(mipsolver, presolve_reduction_limit)) {
@@ -1018,7 +1017,8 @@ void HighsMipSolverData::runSetup() {
10181017
debugSolution.debugSolObjective = 0;
10191018
HighsCDouble debugsolobj = 0.0;
10201019
for (HighsInt i = 0; i != mipsolver.model_->num_col_; ++i)
1021-
debugsolobj += mipsolver.colCost(i) * debugSolution.debugSolution[i];
1020+
debugsolobj +=
1021+
mipsolver.colCost(i) * HighsCDouble(debugSolution.debugSolution[i]);
10221022
debugSolution.debugSolObjective = static_cast<double>(debugsolobj);
10231023
debugSolution.registerDomain(domain);
10241024
assert(checkSolution(debugSolution.debugSolution));

0 commit comments

Comments
 (0)