From a88f3372c21603b97e791757eafda57776752108 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Wed, 19 Aug 2020 20:47:16 +0200 Subject: [PATCH] tentative fix for #1918 --- ortools/sat/linear_constraint_manager.cc | 2 +- ortools/sat/linear_constraint_manager.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ortools/sat/linear_constraint_manager.cc b/ortools/sat/linear_constraint_manager.cc index c3e48f617d..934e530a81 100644 --- a/ortools/sat/linear_constraint_manager.cc +++ b/ortools/sat/linear_constraint_manager.cc @@ -55,7 +55,7 @@ LinearConstraintManager::~LinearConstraintManager() { if (num_coeff_strenghtening_ > 0) { VLOG(2) << "num_coeff_strenghtening: " << num_coeff_strenghtening_; } - if (sat_parameters_.log_search_progress() && num_cuts_ > 0) { + if (log_search_progress_ && num_cuts_ > 0) { LOG(INFO) << "Total cuts added: " << num_cuts_; for (const auto& entry : type_to_num_cuts_) { LOG(INFO) << "Added " << entry.second << " cuts of type '" << entry.first diff --git a/ortools/sat/linear_constraint_manager.h b/ortools/sat/linear_constraint_manager.h index c392d056c5..f75832566b 100644 --- a/ortools/sat/linear_constraint_manager.h +++ b/ortools/sat/linear_constraint_manager.h @@ -66,7 +66,8 @@ class LinearConstraintManager { : sat_parameters_(*model->GetOrCreate()), integer_trail_(*model->GetOrCreate()), time_limit_(model->GetOrCreate()), - model_(model) {} + model_(model), + log_search_progress_(sat_parameters_.log_search_progress()) {} ~LinearConstraintManager(); // Add a new constraint to the manager. Note that we canonicalize constraints @@ -210,6 +211,7 @@ class LinearConstraintManager { double constraint_active_count_increase_ = 1.0; int32 num_deletable_constraints_ = 0; + const bool log_search_progress_; }; } // namespace sat