diff --git a/ortools/base/BUILD.bazel b/ortools/base/BUILD.bazel index ad90666777..4576ad9bbb 100644 --- a/ortools/base/BUILD.bazel +++ b/ortools/base/BUILD.bazel @@ -398,6 +398,7 @@ cc_library( cc_library( name = "memfile", hdrs = ["memfile.h"], + deps = [], ) cc_library( @@ -431,6 +432,7 @@ cc_library( cc_library( name = "mutable_memfile", hdrs = ["mutable_memfile.h"], + deps = [], ) cc_library( diff --git a/ortools/constraint_solver/constraint_solver.h b/ortools/constraint_solver/constraint_solver.h index 3040a32089..a897823a2e 100644 --- a/ortools/constraint_solver/constraint_solver.h +++ b/ortools/constraint_solver/constraint_solver.h @@ -5074,6 +5074,7 @@ class SequenceVar : public PropagationBaseObject { class AssignmentElement { public: AssignmentElement() : activated_(true) {} + AssignmentElement(const AssignmentElement&) = default; void Activate() { activated_ = true; } void Deactivate() { activated_ = false; } @@ -5087,6 +5088,7 @@ class IntVarElement : public AssignmentElement { public: IntVarElement(); explicit IntVarElement(IntVar* var); + IntVarElement(const IntVarElement& element) = default; void Reset(IntVar* var); IntVarElement* Clone(); void Copy(const IntVarElement& element); @@ -5351,9 +5353,8 @@ class AssignmentContainer { /// previous content. void Copy(const AssignmentContainer& container) { Clear(); - for (int i = 0; i < container.elements_.size(); ++i) { - const E& element = container.elements_[i]; - FastAdd(element.Var())->Copy(element); + for (const E& element : container.elements_) { + elements_.emplace_back(element); } } bool Contains(const V* const var) const { diff --git a/ortools/graph/dag_shortest_path_test.cc b/ortools/graph/dag_shortest_path_test.cc index 4d6288aaa4..be1d9ae225 100644 --- a/ortools/graph/dag_shortest_path_test.cc +++ b/ortools/graph/dag_shortest_path_test.cc @@ -605,8 +605,8 @@ void BM_RandomDag(benchmark::State& state) { const int num_nodes = state.range(0); const int num_arcs = num_nodes * state.range(1); const auto [graph, topological_order] = BuildRandomDag(num_nodes, num_arcs); - // Generate at most 20 scenarios of random arc lengths. - const int num_scenarios = std::min(20, (int)state.iterations()); + // Generate 10 scenarios of random arc lengths. + const int num_scenarios = 10; std::vector> arc_lengths_scenarios; for (int _ = 0; _ < num_scenarios; ++_) { arc_lengths_scenarios.push_back(GenerateRandomLengths(graph)); @@ -632,7 +632,8 @@ BENCHMARK(BM_RandomDag) ->ArgPair(1 << 16, 4) ->ArgPair(1 << 16, 16) ->ArgPair(1 << 22, 4) - ->ArgPair(1 << 22, 16); + ->ArgPair(1 << 22, 16) + ->ArgPair(1 << 26, 4); // Don't go bigger, can't run on work station. void BM_LineDag(benchmark::State& state) { const int num_nodes = state.range(0); @@ -1198,8 +1199,8 @@ void BM_RandomDag_K(benchmark::State& state) { const int num_arcs = num_nodes * state.range(1); const int path_count = state.range(2); const auto [graph, topological_order] = BuildRandomDag(num_nodes, num_arcs); - // Generate at most 20 scenarios of random arc lengths. - const int num_scenarios = std::min(20, (int)state.iterations()); + // Generate 10 scenarios of random arc lengths. + const int num_scenarios = 10; std::vector> arc_lengths_scenarios; for (int _ = 0; _ < num_scenarios; ++_) { arc_lengths_scenarios.push_back(GenerateRandomLengths(graph)); diff --git a/ortools/linear_solver/BUILD.bazel b/ortools/linear_solver/BUILD.bazel index fa5667971d..ac5e97dbb3 100644 --- a/ortools/linear_solver/BUILD.bazel +++ b/ortools/linear_solver/BUILD.bazel @@ -316,7 +316,7 @@ cc_library( "@scip", ], "//conditions:default": [], - })+ select({ + }) + select({ ":use_highs": [ "//ortools/linear_solver/proto_solver:highs_proto_solver", "@highs", diff --git a/ortools/linear_solver/java/linear_solver.swig b/ortools/linear_solver/java/linear_solver.swig index 958239412c..150d95d574 100644 --- a/ortools/linear_solver/java/linear_solver.swig +++ b/ortools/linear_solver/java/linear_solver.swig @@ -12,19 +12,11 @@ // limitations under the License. // This .swig file exposes the linear programming and integer programming -// solver. See the C++/Python codelab: (there isn't -// a java codelab yet, as of July 2014) +// solver. // // The java API is pretty much identical to the C++ API, with methods // systematically renamed to the Java-style "lowerCamelCase", and using // the Java-style getProperty() instead of the C++ Property(), for getters. -// -// USAGE EXAMPLES (j/c/g and jt/c/g refer to java/com/google and javatests/...): -// - j/c/g/ortools/samples/LinearProgramming.java -// - j/c/g/ortools/samples/IntegerProgramming.java -// - jt/c/g/ortools/linearsolver/LinearSolverTest.java -// -// TODO(user): unit test all the APIs that are currently marked with 'no test'. %include "enums.swg" // For native Java enum support. %include "stdint.i" diff --git a/ortools/linear_solver/linear_solver.proto b/ortools/linear_solver/linear_solver.proto index 3a8459b13f..d4abec9006 100644 --- a/ortools/linear_solver/linear_solver.proto +++ b/ortools/linear_solver/linear_solver.proto @@ -497,6 +497,8 @@ message MPModelRequest { // These additional solutions may have a worse objective than the main // solution returned in the response. optional int32 populate_additional_solutions_up_to = 11 [default = 0]; + + reserved 12; } // Status returned by the solver. They follow a hierarchical nomenclature, to @@ -658,4 +660,6 @@ message MPSolutionResponse { // additional solutions are different than the main solution described by the // above fields `objective_value` and `variable_value`. repeated MPSolution additional_solutions = 8; + + reserved 9; } diff --git a/ortools/routing/search.cc b/ortools/routing/search.cc index c39bff40b8..e57c32da04 100644 --- a/ortools/routing/search.cc +++ b/ortools/routing/search.cc @@ -2481,7 +2481,7 @@ void GlobalCheapestInsertionFilteredHeuristic::AddNodeEntry( } void InsertionSequenceGenerator::AppendPickupDeliveryMultitourInsertions( - int pickup, int delivery, int vehicle, const std::vector& path, + int pickup, int delivery, int vehicle, absl::Span path, const std::vector& path_node_is_pickup, const std::vector& path_node_is_delivery, InsertionSequenceContainer& insertions) { @@ -2514,7 +2514,7 @@ void InsertionSequenceGenerator::AppendPickupDeliveryMultitourInsertions( } } - auto append = [pickup, delivery, vehicle, num_nodes, &path, &insertions]( + auto append = [pickup, delivery, vehicle, num_nodes, path, &insertions]( int pickup_pos, int delivery_pos) { if (pickup_pos < 0 || num_nodes - 1 <= pickup_pos) return; if (delivery_pos < 0 || num_nodes - 1 <= delivery_pos) return; diff --git a/ortools/routing/search.h b/ortools/routing/search.h index 95da515b49..30bfa8a719 100644 --- a/ortools/routing/search.h +++ b/ortools/routing/search.h @@ -1097,7 +1097,7 @@ class InsertionSequenceGenerator { /// are made on the subpath of paired nodes, all extensions to the original /// path that conserve order are equivalent. void AppendPickupDeliveryMultitourInsertions( - int pickup, int delivery, int vehicle, const std::vector& path, + int pickup, int delivery, int vehicle, absl::Span path, const std::vector& path_node_is_pickup, const std::vector& path_node_is_delivery, InsertionSequenceContainer& insertions); diff --git a/ortools/util/java/tuple_set.swig b/ortools/util/java/tuple_set.swig index 110eb497b5..51caafcfa3 100644 --- a/ortools/util/java/tuple_set.swig +++ b/ortools/util/java/tuple_set.swig @@ -41,4 +41,4 @@ %rename (sortedLexicographically) operations_research::IntTupleSet::SortedLexicographically; %rename (value) operations_research::IntTupleSet::Value; -%include ortools/util/tuple_set.h +%include "ortools/util/tuple_set.h"