Skip to content

Commit c259a7e

Browse files
committed
Fixed error in readSolutionFile; user solution now read correctly in #2463 formatted
1 parent ebe985f commit c259a7e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

highs/lp_data/HighsLpUtils.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ HighsStatus readSolutionFile(const std::string filename,
21292129
if (!readSolutionFileHashKeywordIntLineOk(hash, keyword, value_string,
21302130
num_col, in_file)) {
21312131
highsLogUser(log_options, HighsLogType::kError,
2132-
"readSolutionFile: Error reading line \"%s %s %s\"",
2132+
"readSolutionFile: Error reading line \"%s %s %s\"\n",
21332133
hash.c_str(), keyword.c_str(), value_string.c_str());
21342134
return readSolutionFileErrorReturn(in_file);
21352135
}
@@ -2210,10 +2210,10 @@ HighsStatus readSolutionFile(const std::string filename,
22102210
return readSolutionFileReturn(HighsStatus::kOk, solution, basis,
22112211
read_solution, read_basis, in_file);
22122212
}
2213-
// Read in the col values: OK to have none, otherwise next line
2213+
// Read in the row values: OK to have none, otherwise next line
22142214
// should be "Rows" and correct number
22152215
if (!readSolutionFileHashKeywordIntLineOk(hash, keyword, value_string,
2216-
num_col, in_file)) {
2216+
num_row, in_file)) {
22172217
// Compute the row values since there are none to read
22182218
if (calculateRowValuesQuad(lp, read_solution.col_value,
22192219
read_solution.row_value) != HighsStatus::kOk)
@@ -2286,7 +2286,7 @@ HighsStatus readSolutionFile(const std::string filename,
22862286
if (!readSolutionFileHashKeywordIntLineOk(hash, keyword, value_string,
22872287
num_col, in_file)) {
22882288
highsLogUser(log_options, HighsLogType::kError,
2289-
"readSolutionFile: Error reading line \"%s %s %s\"",
2289+
"readSolutionFile: Error reading line \"%s %s %s\"\n",
22902290
hash.c_str(), keyword.c_str(), value_string.c_str());
22912291
return readSolutionFileReturn(HighsStatus::kOk, solution, basis,
22922292
read_solution, read_basis, in_file);
@@ -2310,12 +2310,12 @@ HighsStatus readSolutionFile(const std::string filename,
23102310
}
23112311
read_solution.col_dual[iCol] = dual;
23122312
}
2313-
// Read in the col values: next line should be "Rows" and correct
2313+
// Read in the col dual values: next line should be "Rows" and correct
23142314
// number
23152315
if (!readSolutionFileHashKeywordIntLineOk(hash, keyword, value_string,
23162316
num_col, in_file)) {
23172317
highsLogUser(log_options, HighsLogType::kError,
2318-
"readSolutionFile: Error reading line \"%s %s %s\"",
2318+
"readSolutionFile: Error reading line \"%s %s %s\"\n",
23192319
hash.c_str(), keyword.c_str(), value_string.c_str());
23202320
return readSolutionFileReturn(HighsStatus::kOk, solution, basis,
23212321
read_solution, read_basis, in_file);

highs/mip/HighsMipSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ HighsMipSolver::HighsMipSolver(HighsCallback& callback,
4545
assert(!submip || submip_level > 0);
4646
max_submip_level = 0;
4747
if (solution.value_valid) {
48+
#ifndef NDEBUG
4849
// MIP solver doesn't check row residuals, but they should be OK
4950
// so validate using assert
50-
#ifndef NDEBUG
5151
bool valid, integral, feasible;
5252
assessLpPrimalSolution("For debugging: ", options, lp, solution, valid,
5353
integral, feasible);

0 commit comments

Comments
 (0)