From 4ca1add04e8e77a030d030c70dfc7d14e8940440 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Fri, 20 Jan 2023 14:20:41 +0100 Subject: [PATCH] sync after export tool change --- ortools/sat/cuts.cc | 1 + ortools/sat/diffn_util.cc | 2 +- ortools/sat/docs/README.md | 3 +-- ortools/sat/docs/boolean_logic.md | 2 +- ortools/sat/docs/channeling.md | 2 +- ortools/sat/docs/integer_arithmetic.md | 2 +- ortools/sat/docs/model.md | 2 +- ortools/sat/docs/scheduling.md | 2 +- ortools/sat/docs/solver.md | 2 +- ortools/sat/util.cc | 1 + 10 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ortools/sat/cuts.cc b/ortools/sat/cuts.cc index 02339d6cdc..32a2cb2409 100644 --- a/ortools/sat/cuts.cc +++ b/ortools/sat/cuts.cc @@ -1027,6 +1027,7 @@ bool CoverCutHelper::TrySimpleKnapsack(const CutData& input) { alt_cut_.Clear(); base_ct_ = input; + if (base_ct_.rhs < 0) return false; // Now make each coeff positive. // diff --git a/ortools/sat/diffn_util.cc b/ortools/sat/diffn_util.cc index 78af2efcd6..8a8dd7e9d3 100644 --- a/ortools/sat/diffn_util.cc +++ b/ortools/sat/diffn_util.cc @@ -423,7 +423,7 @@ void GetOverlappingIntervalComponents( // If that becomes a performance bottleneck: // - One may want to sort the list outside of this function, and simply // have this function DCHECK that it's sorted by start. - // - One may use std::stable_sort() with ComparatorByStart(). + // - One may use stable_sort() with ComparatorByStart(). std::sort(intervals->begin(), intervals->end(), IndexedInterval::ComparatorByStartThenEndThenIndex()); diff --git a/ortools/sat/docs/README.md b/ortools/sat/docs/README.md index 90e348e84d..980ae2618a 100644 --- a/ortools/sat/docs/README.md +++ b/ortools/sat/docs/README.md @@ -15,10 +15,10 @@ https://developers.google.com/optimization/cp/cp_solver * [Java code samples](#java-code-samples) * [C# code samples](#c-code-samples-1) + - ## Documentation structure This document presents modeling recipes for the CP-SAT solver. @@ -184,7 +184,6 @@ public final class SimpleSatProgram { The C\# code implements the same interface as the Python code, with a **CpModel** and a **CpSolver** class. - ```cs using System; using Google.OrTools.Sat; diff --git a/ortools/sat/docs/boolean_logic.md b/ortools/sat/docs/boolean_logic.md index 93bd844ad3..357eae35fc 100644 --- a/ortools/sat/docs/boolean_logic.md +++ b/ortools/sat/docs/boolean_logic.md @@ -27,10 +27,10 @@ https://developers.google.com/optimization/ * [Product of two Boolean Variables](#product-of-two-boolean-variables) * [Python code](#python-code-3) + - ## Introduction The CP-SAT solver can express Boolean variables and constraints. A **Boolean diff --git a/ortools/sat/docs/channeling.md b/ortools/sat/docs/channeling.md index 108d66de65..9a1e8eb1cd 100644 --- a/ortools/sat/docs/channeling.md +++ b/ortools/sat/docs/channeling.md @@ -18,10 +18,10 @@ https://developers.google.com/optimization/ * [Java code](#java-code-1) * [C# code](#c-code-3) + - A *channeling constraint* links variables inside a model. They're used when you want to express a complicated relationship between variables, such as "if this variable satisfies a condition, force another variable to a particular value". diff --git a/ortools/sat/docs/integer_arithmetic.md b/ortools/sat/docs/integer_arithmetic.md index c4078fa41d..5c6337b6fa 100644 --- a/ortools/sat/docs/integer_arithmetic.md +++ b/ortools/sat/docs/integer_arithmetic.md @@ -34,10 +34,10 @@ https://developers.google.com/optimization/ * [Java code](#java-code-2) * [C# code](#c-code-5) + - ## Introduction The CP-SAT solver can express integer variables and constraints. diff --git a/ortools/sat/docs/model.md b/ortools/sat/docs/model.md index 8c781dfc79..fa51b710d1 100644 --- a/ortools/sat/docs/model.md +++ b/ortools/sat/docs/model.md @@ -17,10 +17,10 @@ https://developers.google.com/optimization/ * [Python code](#python-code-1) * [C++ code](#c-code-2) + - ## Introduction In all languages, the CpModel class is a thin wrapper around a diff --git a/ortools/sat/docs/scheduling.md b/ortools/sat/docs/scheduling.md index 661310873d..2e8f64ea16 100644 --- a/ortools/sat/docs/scheduling.md +++ b/ortools/sat/docs/scheduling.md @@ -39,10 +39,10 @@ https://developers.google.com/optimization/ * [Convex hull of a set of intervals](#convex-hull-of-a-set-of-intervals) * [Reservoir constraint](#reservoir-constraint) + - ## Introduction Scheduling in Operations Research involves problems of tasks, resources and diff --git a/ortools/sat/docs/solver.md b/ortools/sat/docs/solver.md index 36e50b376d..237fef1f31 100644 --- a/ortools/sat/docs/solver.md +++ b/ortools/sat/docs/solver.md @@ -28,10 +28,10 @@ https://developers.google.com/optimization/ * [Java code](#java-code-2) * [C# code](#c-code-5) + - ## Changing the parameters of the solver The SatParameters protobuf encapsulates the set of parameters of a CP-SAT diff --git a/ortools/sat/util.cc b/ortools/sat/util.cc index ff5bf3b17c..8d35a30ef2 100644 --- a/ortools/sat/util.cc +++ b/ortools/sat/util.cc @@ -87,6 +87,7 @@ void RandomizeDecisionHeuristic(absl::BitGenRef random, namespace { // This will be optimized into one division. I tested that in other places: +// 3/ortools/sat/integer_test.cc;l=1223-1228;bpv=0 // // Note that I am not 100% sure we need the indirection for the optimization // to kick in though, but this seemed safer given our weird r[i ^ 1] inputs.