Skip to content

Commit

Permalink
Merge pull request #1806 from ERGO-Code/fix-1805
Browse files Browse the repository at this point in the history
Now passing nullptr to writeModelBoundSolution if lp.integrality_.size() = 0
  • Loading branch information
jajhall authored Jun 18, 2024
2 parents 78df449 + eae4ede commit 3aca707
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lp_data/HighsModelUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,12 @@ void writeSolutionFile(FILE* file, const HighsOptions& options,
if (style == kSolutionStyleOldRaw) {
writeOldRawSolution(file, lp, basis, solution);
} else if (style == kSolutionStylePretty) {
writeModelBoundSolution(
file, true, lp.num_col_, lp.col_lower_, lp.col_upper_, lp.col_names_,
have_primal, solution.col_value, have_dual, solution.col_dual,
have_basis, basis.col_status, lp.integrality_.data());
const HighsVarType* integrality =
lp.integrality_.size() > 0 ? lp.integrality_.data() : nullptr;
writeModelBoundSolution(file, true, lp.num_col_, lp.col_lower_,
lp.col_upper_, lp.col_names_, have_primal,
solution.col_value, have_dual, solution.col_dual,
have_basis, basis.col_status, integrality);
writeModelBoundSolution(file, false, lp.num_row_, lp.row_lower_,
lp.row_upper_, lp.row_names_, have_primal,
solution.row_value, have_dual, solution.row_dual,
Expand Down

0 comments on commit 3aca707

Please sign in to comment.