Skip to content

Commit bd641e1

Browse files
committed
ortools: export from google3
1 parent badef91 commit bd641e1

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

ortools/base/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ cc_library(
398398
cc_library(
399399
name = "memfile",
400400
hdrs = ["memfile.h"],
401+
deps = [],
401402
)
402403

403404
cc_library(
@@ -431,6 +432,7 @@ cc_library(
431432
cc_library(
432433
name = "mutable_memfile",
433434
hdrs = ["mutable_memfile.h"],
435+
deps = [],
434436
)
435437

436438
cc_library(

ortools/constraint_solver/constraint_solver.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5074,6 +5074,7 @@ class SequenceVar : public PropagationBaseObject {
50745074
class AssignmentElement {
50755075
public:
50765076
AssignmentElement() : activated_(true) {}
5077+
AssignmentElement(const AssignmentElement&) = default;
50775078

50785079
void Activate() { activated_ = true; }
50795080
void Deactivate() { activated_ = false; }
@@ -5087,6 +5088,7 @@ class IntVarElement : public AssignmentElement {
50875088
public:
50885089
IntVarElement();
50895090
explicit IntVarElement(IntVar* var);
5091+
IntVarElement(const IntVarElement& element) = default;
50905092
void Reset(IntVar* var);
50915093
IntVarElement* Clone();
50925094
void Copy(const IntVarElement& element);
@@ -5351,9 +5353,8 @@ class AssignmentContainer {
53515353
/// previous content.
53525354
void Copy(const AssignmentContainer<V, E>& container) {
53535355
Clear();
5354-
for (int i = 0; i < container.elements_.size(); ++i) {
5355-
const E& element = container.elements_[i];
5356-
FastAdd(element.Var())->Copy(element);
5356+
for (const E& element : container.elements_) {
5357+
elements_.emplace_back(element);
53575358
}
53585359
}
53595360
bool Contains(const V* const var) const {

ortools/constraint_solver/routing_search.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,7 +2481,7 @@ void GlobalCheapestInsertionFilteredHeuristic::AddNodeEntry(
24812481
}
24822482

24832483
void InsertionSequenceGenerator::AppendPickupDeliveryMultitourInsertions(
2484-
int pickup, int delivery, int vehicle, const std::vector<int>& path,
2484+
int pickup, int delivery, int vehicle, absl::Span<const int> path,
24852485
const std::vector<bool>& path_node_is_pickup,
24862486
const std::vector<bool>& path_node_is_delivery,
24872487
InsertionSequenceContainer& insertions) {
@@ -2514,7 +2514,7 @@ void InsertionSequenceGenerator::AppendPickupDeliveryMultitourInsertions(
25142514
}
25152515
}
25162516

2517-
auto append = [pickup, delivery, vehicle, num_nodes, &path, &insertions](
2517+
auto append = [pickup, delivery, vehicle, num_nodes, path, &insertions](
25182518
int pickup_pos, int delivery_pos) {
25192519
if (pickup_pos < 0 || num_nodes - 1 <= pickup_pos) return;
25202520
if (delivery_pos < 0 || num_nodes - 1 <= delivery_pos) return;

ortools/constraint_solver/routing_search.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ class InsertionSequenceGenerator {
10991099
/// are made on the subpath of paired nodes, all extensions to the original
11001100
/// path that conserve order are equivalent.
11011101
void AppendPickupDeliveryMultitourInsertions(
1102-
int pickup, int delivery, int vehicle, const std::vector<int>& path,
1102+
int pickup, int delivery, int vehicle, absl::Span<const int> path,
11031103
const std::vector<bool>& path_node_is_pickup,
11041104
const std::vector<bool>& path_node_is_delivery,
11051105
InsertionSequenceContainer& insertions);

ortools/graph/dag_shortest_path_test.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,8 @@ void BM_RandomDag(benchmark::State& state) {
605605
const int num_nodes = state.range(0);
606606
const int num_arcs = num_nodes * state.range(1);
607607
const auto [graph, topological_order] = BuildRandomDag(num_nodes, num_arcs);
608-
// Generate at most 20 scenarios of random arc lengths.
609-
const int num_scenarios = std::min(20, (int)state.iterations());
608+
// Generate 10 scenarios of random arc lengths.
609+
const int num_scenarios = 10;
610610
std::vector<std::vector<double>> arc_lengths_scenarios;
611611
for (int _ = 0; _ < num_scenarios; ++_) {
612612
arc_lengths_scenarios.push_back(GenerateRandomLengths(graph));
@@ -632,7 +632,8 @@ BENCHMARK(BM_RandomDag)
632632
->ArgPair(1 << 16, 4)
633633
->ArgPair(1 << 16, 16)
634634
->ArgPair(1 << 22, 4)
635-
->ArgPair(1 << 22, 16);
635+
->ArgPair(1 << 22, 16)
636+
->ArgPair(1 << 26, 4); // Don't go bigger, can't run on work station.
636637

637638
void BM_LineDag(benchmark::State& state) {
638639
const int num_nodes = state.range(0);
@@ -1198,8 +1199,8 @@ void BM_RandomDag_K(benchmark::State& state) {
11981199
const int num_arcs = num_nodes * state.range(1);
11991200
const int path_count = state.range(2);
12001201
const auto [graph, topological_order] = BuildRandomDag(num_nodes, num_arcs);
1201-
// Generate at most 20 scenarios of random arc lengths.
1202-
const int num_scenarios = std::min(20, (int)state.iterations());
1202+
// Generate 10 scenarios of random arc lengths.
1203+
const int num_scenarios = 10;
12031204
std::vector<std::vector<double>> arc_lengths_scenarios;
12041205
for (int _ = 0; _ < num_scenarios; ++_) {
12051206
arc_lengths_scenarios.push_back(GenerateRandomLengths(graph));

ortools/linear_solver/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ cc_library(
316316
"@scip",
317317
],
318318
"//conditions:default": [],
319-
})+ select({
319+
}) + select({
320320
":use_highs": [
321321
"//ortools/linear_solver/proto_solver:highs_proto_solver",
322322
"@highs",

ortools/linear_solver/java/linear_solver.swig

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,11 @@
1212
// limitations under the License.
1313

1414
// This .swig file exposes the linear programming and integer programming
15-
// solver. See the C++/Python codelab: (there isn't
16-
// a java codelab yet, as of July 2014)
15+
// solver.
1716
//
1817
// The java API is pretty much identical to the C++ API, with methods
1918
// systematically renamed to the Java-style "lowerCamelCase", and using
2019
// the Java-style getProperty() instead of the C++ Property(), for getters.
21-
//
22-
// USAGE EXAMPLES (j/c/g and jt/c/g refer to java/com/google and javatests/...):
23-
// - j/c/g/ortools/samples/LinearProgramming.java
24-
// - j/c/g/ortools/samples/IntegerProgramming.java
25-
// - jt/c/g/ortools/linearsolver/LinearSolverTest.java
26-
//
27-
// TODO(user): unit test all the APIs that are currently marked with 'no test'.
2820

2921
%include "enums.swg" // For native Java enum support.
3022
%include "stdint.i"

ortools/linear_solver/linear_solver.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,8 @@ message MPModelRequest {
497497
// These additional solutions may have a worse objective than the main
498498
// solution returned in the response.
499499
optional int32 populate_additional_solutions_up_to = 11 [default = 0];
500+
501+
reserved 12;
500502
}
501503

502504
// Status returned by the solver. They follow a hierarchical nomenclature, to
@@ -658,4 +660,6 @@ message MPSolutionResponse {
658660
// additional solutions are different than the main solution described by the
659661
// above fields `objective_value` and `variable_value`.
660662
repeated MPSolution additional_solutions = 8;
663+
664+
reserved 9;
661665
}

ortools/util/java/tuple_set.swig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@
4141
%rename (sortedLexicographically) operations_research::IntTupleSet::SortedLexicographically;
4242
%rename (value) operations_research::IntTupleSet::Value;
4343

44-
%include ortools/util/tuple_set.h
44+
%include "ortools/util/tuple_set.h"

0 commit comments

Comments
 (0)