Skip to content

Commit b49d5b5

Browse files
committed
Correct efficacy calculation
1 parent 76b30a4 commit b49d5b5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

highs/mip/HighsTransformedLp.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -942,13 +942,17 @@ bool HighsTransformedLp::cleanup(std::vector<HighsInt>& inds,
942942
double sqrnorm = 0;
943943
const std::vector<double>& lpSolution = lprelaxation.getSolution().col_value;
944944
for (HighsInt i = 0; i != numNz; ++i) {
945-
if (lpSolution[i] >=
945+
if (lpSolution[i] <=
946946
mip.mipdata_->domain.col_lower_[i] + mip.mipdata_->feastol)
947947
continue;
948948
viol += vals[i] * lpSolution[i];
949949
sqrnorm += vals[i] * vals[i];
950950
}
951-
efficacy = viol / sqrt(sqrnorm);
951+
if (sqrnorm == 0) {
952+
efficacy = 0;
953+
} else {
954+
efficacy = viol / sqrt(sqrnorm);
955+
}
952956

953957
return true;
954958
}

0 commit comments

Comments
 (0)