This commit is contained in:
Laurent Perron
2024-02-18 12:16:15 +01:00
parent 3dc612e1df
commit 2f11ce5fa5
3 changed files with 5 additions and 5 deletions

View File

@@ -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",
],
)

View File

@@ -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);

View File

@@ -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;