From eae4eded0501c68ae3041a5df273b2c3a21953e1 Mon Sep 17 00:00:00 2001 From: JAJHall Date: Mon, 17 Jun 2024 22:13:34 +0100 Subject: [PATCH] Now passing nullptr to writeModelBoundSolution if lp.integrality_.size() = 0 --- src/lp_data/HighsModelUtils.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lp_data/HighsModelUtils.cpp b/src/lp_data/HighsModelUtils.cpp index cc48527032..1e878740b0 100644 --- a/src/lp_data/HighsModelUtils.cpp +++ b/src/lp_data/HighsModelUtils.cpp @@ -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,