Skip to content

Commit 1c2cb33

Browse files
committed
Replaced several silent = mipsolver && mipsolver->mipdata_->numRestarts > 0; by silentLog()
1 parent 9b202d2 commit 1c2cb33

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

highs/presolve/HPresolve.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,7 @@ HPresolve::Result HPresolve::runProbing(HighsPostsolveStack& postsolve_stack) {
16851685

16861686
assert(mipsolver);
16871687
// Don't log probing for presolve before restart
1688-
const bool silent = mipsolver->mipdata_->numRestarts > 0;
1688+
const bool silent = silentLog();
16891689
HighsInt iBin = -1;
16901690
HighsInt iBin_probed = -1;
16911691
HighsInt num_binary = binaries.size();
@@ -5523,7 +5523,7 @@ HPresolve::Result HPresolve::presolve(HighsPostsolveStack& postsolve_stack) {
55235523
model->sense_ = ObjSense::kMinimize;
55245524
}
55255525

5526-
const bool silent = mipsolver && mipsolver->mipdata_->numRestarts > 0;
5526+
const bool silent = silentLog();
55275527
if (options->presolve != kHighsOffString) {
55285528
if (!silent)
55295529
highsLogUser(options->log_options, HighsLogType::kInfo,
@@ -5549,7 +5549,7 @@ HPresolve::Result HPresolve::presolve(HighsPostsolveStack& postsolve_stack) {
55495549
if (options->timeless_log) time_str = "";
55505550
highsLogUser(options->log_options, HighsLogType::kInfo,
55515551
"%" HIGHSINT_FORMAT " rows, %" HIGHSINT_FORMAT
5552-
" cols, %" HIGHSINT_FORMAT " nonzeros %s\n",
5552+
" cols, %" HIGHSINT_FORMAT " nonzeros %s\n",
55535553
numRow, numCol, numNonz, time_str.c_str());
55545554
}
55555555
};
@@ -6025,6 +6025,10 @@ HighsCDouble HPresolve::computeDynamism(
60256025
static_cast<HighsCDouble>(minAbsCoef);
60266026
}
60276027

6028+
bool HPresolve::silentLog() const {
6029+
return mipsolver && mipsolver->mipdata_->numRestarts > 0;
6030+
}
6031+
60286032
HighsModelStatus HPresolve::run(HighsPostsolveStack& postsolve_stack) {
60296033
presolve_status_ = HighsPresolveStatus::kNotSet;
60306034
shrinkProblemEnabled = true;
@@ -6224,7 +6228,7 @@ HPresolve::Result HPresolve::removeDependentEquations(
62246228
const double time_limit =
62256229
std::max(1.0, std::min(0.01 * options->time_limit, 1000.0));
62266230
factor.setTimeLimit(time_limit);
6227-
const bool silent = mipsolver && mipsolver->mipdata_->numRestarts > 0;
6231+
const bool silent = silentLog();
62286232
// Determine rank deficiency of the equations
62296233
if (!silent)
62306234
highsLogUser(options->log_options, HighsLogType::kInfo,

highs/presolve/HPresolve.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ class HPresolve {
348348
template <typename storageFormat>
349349
HighsCDouble computeDynamism(const HighsMatrixSlice<storageFormat>& vector);
350350

351+
bool silentLog() const;
352+
351353
public:
352354
// for LP presolve
353355
bool okSetInput(HighsLp& model_, const HighsOptions& options_,

0 commit comments

Comments
 (0)