diff --git a/ortools/sat/BUILD.bazel b/ortools/sat/BUILD.bazel index 64344b7953..eeec8bcd7e 100644 --- a/ortools/sat/BUILD.bazel +++ b/ortools/sat/BUILD.bazel @@ -1361,6 +1361,7 @@ cc_library( "@com_google_absl//absl/log:check", "@com_google_absl//absl/meta:type_traits", "@com_google_absl//absl/types:span", + "@com_google_protobuf//:protobuf", ], ) diff --git a/ortools/sat/integer.h b/ortools/sat/integer.h index cadea7edd5..a4629893bd 100644 --- a/ortools/sat/integer.h +++ b/ortools/sat/integer.h @@ -1413,7 +1413,7 @@ class GenericLiteralWatcher : public SatPropagator { void WatchUpperBound(IntegerVariable var, int id, int watch_index = -1); void WatchIntegerVariable(IntegerVariable i, int id, int watch_index = -1); - // Because the coeff is always positive, whatching an affine expression is + // Because the coeff is always positive, watching an affine expression is // the same as watching its var. void WatchLowerBound(AffineExpression e, int id) { WatchLowerBound(e.var, id); diff --git a/ortools/sat/linear_relaxation.cc b/ortools/sat/linear_relaxation.cc index 1386e3e53f..d11911d35c 100644 --- a/ortools/sat/linear_relaxation.cc +++ b/ortools/sat/linear_relaxation.cc @@ -27,6 +27,7 @@ #include "absl/log/check.h" #include "absl/meta/type_traits.h" #include "absl/types/span.h" +#include "google/protobuf/message.h" #include "ortools/base/logging.h" #include "ortools/base/mathutil.h" #include "ortools/base/stl_util.h" @@ -1438,7 +1439,7 @@ void TryToLinearizeConstraint(const CpModelProto& /*model_proto*/, PossibleOverflow(integer_trail, relaxation->linear_constraints[i]); if (issue) { LOG(INFO) << "Possible overflow in linearization of: " - << ct.ShortDebugString(); + << google::protobuf::ShortFormat(ct); } } } @@ -1946,8 +1947,7 @@ LinearRelaxation ComputeLinearRelaxation(const CpModelProto& model_proto, return relaxation; } } else if (lc.num_terms == 1) { - const AffineExpression expr = - AffineExpression(lc.vars[0], lc.coeffs[0]); + const AffineExpression expr(lc.vars[0], lc.coeffs[0]); if (lc.lb > integer_trail->LevelZeroLowerBound(expr)) { if (!integer_trail->Enqueue(expr.GreaterOrEqual(lc.lb), {}, {})) { return relaxation; @@ -1958,7 +1958,6 @@ LinearRelaxation ComputeLinearRelaxation(const CpModelProto& model_proto, return relaxation; } } - break; } } if (!sat_solver->FinishPropagation()) return relaxation;