ortools: export from google3
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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<V, E>& 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 {
|
||||
|
||||
@@ -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<std::vector<double>> 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<std::vector<double>> arc_lengths_scenarios;
|
||||
for (int _ = 0; _ < num_scenarios; ++_) {
|
||||
arc_lengths_scenarios.push_back(GenerateRandomLengths(graph));
|
||||
|
||||
@@ -316,7 +316,7 @@ cc_library(
|
||||
"@scip",
|
||||
],
|
||||
"//conditions:default": [],
|
||||
})+ select({
|
||||
}) + select({
|
||||
":use_highs": [
|
||||
"//ortools/linear_solver/proto_solver:highs_proto_solver",
|
||||
"@highs",
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -2481,7 +2481,7 @@ void GlobalCheapestInsertionFilteredHeuristic::AddNodeEntry(
|
||||
}
|
||||
|
||||
void InsertionSequenceGenerator::AppendPickupDeliveryMultitourInsertions(
|
||||
int pickup, int delivery, int vehicle, const std::vector<int>& path,
|
||||
int pickup, int delivery, int vehicle, absl::Span<const int> path,
|
||||
const std::vector<bool>& path_node_is_pickup,
|
||||
const std::vector<bool>& 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;
|
||||
|
||||
@@ -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<int>& path,
|
||||
int pickup, int delivery, int vehicle, absl::Span<const int> path,
|
||||
const std::vector<bool>& path_node_is_pickup,
|
||||
const std::vector<bool>& path_node_is_delivery,
|
||||
InsertionSequenceContainer& insertions);
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user