Skip to content

Commit

Permalink
Merge pull request #2161 from ERGO-Code/fix-log-header
Browse files Browse the repository at this point in the history
Now only recording written_log_header_ = true if output_flag is true …
  • Loading branch information
jajhall authored Jan 30, 2025
2 parents aa53030 + 6fb8f36 commit 52af45f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Highs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ class Highs {
bool called_return_from_run = true;
HighsInt debug_run_call_num_ = 0;

bool written_log_header = false;
bool written_log_header_ = false;

HighsStatus solve();

Expand Down
6 changes: 4 additions & 2 deletions src/lp_data/Highs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1717,6 +1717,7 @@ HighsStatus Highs::getStandardFormLp(HighsInt& num_col, HighsInt& num_row,
HighsInt& num_nz, double& offset,
double* cost, double* rhs, HighsInt* start,
HighsInt* index, double* value) {
this->logHeader();
if (!this->standard_form_valid_) {
HighsStatus status = formStandardFormLp();
assert(status == HighsStatus::kOk);
Expand Down Expand Up @@ -4249,9 +4250,10 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,

// End of public methods
void Highs::logHeader() {
if (written_log_header) return;
if (written_log_header_) return;
if (!*options_.log_options.output_flag) return;
highsLogHeader(options_.log_options, options_.log_githash);
written_log_header = true;
written_log_header_ = true;
return;
}

Expand Down

0 comments on commit 52af45f

Please sign in to comment.