Skip to content

Commit 0a9b58d

Browse files
authored
Merge pull request #1435 from ERGO-Code/fix-1434
Fixed error in Highs::callRunPostsolve
2 parents f973b8a + 15589ef commit 0a9b58d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/lp_data/Highs.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3253,7 +3253,7 @@ HighsStatus Highs::callSolveQp() {
32533253
highsLogUser(options_.log_options, HighsLogType::kInfo,
32543254
"Iteration, Runtime, ObjVal, NullspaceDim\n");
32553255

3256-
QpModelStatus qp_model_status;
3256+
QpModelStatus qp_model_status = QpModelStatus::INDETERMINED;
32573257

32583258
QpSolution qp_solution(instance);
32593259

@@ -3468,8 +3468,9 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
34683468
const HighsLp& presolved_lp = presolve_.getReducedProblem();
34693469

34703470
if (this->model_.isMip() && !basis.valid) {
3471-
// Postsolving a MIP without a valid basis - which would imply
3472-
// that the relaxation was being solved
3471+
// Postsolving a MIP without a valid basis - which, if valid,
3472+
// would imply that the relaxation had been solved, a case handled
3473+
// below
34733474
presolve_.data_.recovered_solution_ = solution;
34743475
if (HighsInt(presolve_.data_.recovered_solution_.col_value.size()) <
34753476
presolved_lp.num_col_) {
@@ -3494,9 +3495,9 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
34943495
this->basis_, this->info_);
34953496
double& max_integrality_violation = this->info_.max_integrality_violation;
34963497
max_integrality_violation = 0;
3497-
for (HighsInt iCol = 0; iCol != lp.num_col_; iCol++) {
3498+
for (HighsInt iCol = 0; iCol < lp.num_col_; iCol++) {
34983499
if (lp.integrality_[iCol] == HighsVarType::kInteger) {
3499-
const double value = solution.col_value[iCol];
3500+
const double value = this->solution_.col_value[iCol];
35003501
double intval = std::floor(value + 0.5);
35013502
max_integrality_violation =
35023503
std::max(fabs(intval - value), max_integrality_violation);

0 commit comments

Comments
 (0)