Skip to content

Commit

Permalink
Now passing nullptr to writeModelBoundSolution if lp.integrality_.siz…
Browse files Browse the repository at this point in the history
…e() = 0
  • Loading branch information
jajhall committed Jun 17, 2024
1 parent 78df449 commit eae4ede
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 eae4ede

Please sign in to comment.