Skip to content

Commit 0642101

Browse files
committed
Cleaned up code to skip statement of Log File as Highs.log; formatted
1 parent ccfb773 commit 0642101

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

app/HighsRuntimeOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
#include <cassert>
1616

17-
#include "extern/CLI11.hpp"
1817
#include "HConfig.h"
18+
#include "extern/CLI11.hpp"
1919
#include "io/HighsIO.h"
2020
#include "io/LoadOptions.h"
2121
#include "util/stringutil.h"

app/RunHighs.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ static bool written_cli_copyright_line = false;
1717

1818
void cliCopyrightLine(const HighsLogOptions& log_options) {
1919
if (written_cli_copyright_line) return;
20-
highsLogUser(log_options, HighsLogType::kInfo, "Command line parsed using CLI11 %s: Copyright (c) 2017-2025 University of Cincinnati\n", CLI11_VERSION);
21-
written_cli_copyright_line = true;
20+
highsLogUser(log_options, HighsLogType::kInfo,
21+
"Command line parsed using CLI11 %s: Copyright (c) 2017-2025 "
22+
"University of Cincinnati\n",
23+
CLI11_VERSION);
24+
written_cli_copyright_line = true;
2225
}
2326

2427
int runHighsReturn(Highs& highs, const int status) {

highs/lp_data/HighsOptions.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -923,11 +923,15 @@ void reportOptions(FILE* file, const HighsLogOptions& log_options,
923923
for (HighsInt index = 0; index < num_options; index++) {
924924
HighsOptionType type = option_records[index]->type;
925925
if (option_records[index]->name == kLogFileString) {
926-
auto option = ((OptionRecordString*)option_records[index])[0];
927-
printf("Found Log File option with value %s\n", option.value->c_str());
928-
if (*option.value == kHighsRunLogFile) continue;
926+
// Default HiGHS log file name is "" so that deviations from it
927+
// trigger opening the log file. However, it's unnecessary to
928+
// report the deviation to kLogFileString, which is the default
929+
// non-empty log file name in HighsRun.cpp
930+
if (*((OptionRecordString*)option_records[index])[0].value ==
931+
kHighsRunLogFile)
932+
continue;
929933
}
930-
934+
931935
// Only report non-advanced options
932936
if (option_records[index]->advanced) {
933937
// Possibly skip the advanced options when creating Md file

highs/presolve/HPresolve.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5126,7 +5126,8 @@ HPresolve::Result HPresolve::enumerateSolutions(
51265126

51275127
// no reductions for this row?
51285128
if (noReductions) {
5129-
while (doBacktrack(numBranches));
5129+
while (doBacktrack(numBranches))
5130+
;
51305131
continue;
51315132
}
51325133

0 commit comments

Comments
 (0)