or-tools 0.14.2 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2974585825c8e1f3d50aabc494131861eef79c80468a889537f58b2dd3926be
4
- data.tar.gz: 5f9b8fe4574a30ebea1fba0b53a91475683e68fe5e535ba99047a6f2b3a16173
3
+ metadata.gz: cf6aeeb8a03deeb23478d655a7844b3e49115252fd8ad5cc7285074370580952
4
+ data.tar.gz: 67db36ddc806b7a2695ea89c9bb2dc3969161df739059e186aed6d67506c4348
5
5
  SHA512:
6
- metadata.gz: 48fc84cebe3a922044a98909dd8b06d61712ea1bdf06014b99a0a92dd4406766facd99cd3f2c99425257642ef08ad5a489d9ee87f354cf7f5d16a3d7ff306d5e
7
- data.tar.gz: 6edc981eb8b47f716f607be3e7c28a59c49076810a7fcbda7077fcc3a1abcf420fe58c17d372a40447f435e7abfd68879fc471b0c8c86afdd4d1610786b0489e
6
+ metadata.gz: 65d8e93c059aa9df5501d8db5252279ede1b85601785663ff0ff41a9e1b5555976c5b9a4304ebfe557d9e9e7802ba30635644b8b857c219e4c925db4d18d8e24
7
+ data.tar.gz: 3a76c22bc257260861751d79a79cb94f880c4d8f5c82ab7b00d249da586ef05283c031f8517ca77621848b0e0fdc6993e1c81ac9f116d2cae50073dd25177109
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 0.15.1 (2025-06-18)
2
+
3
+ - Fixed error with Rice 4.6
4
+
5
+ ## 0.15.0 (2025-02-17)
6
+
7
+ - Updated OR-Tools to 9.12
8
+ - Removed `pickup_positions` and `pickup_index_pairs` (use `pickup_position` instead)
9
+ - Removed `delivery_positions` and `delivery_index_pairs` (use `delivery_position` instead)
10
+
1
11
  ## 0.14.2 (2025-02-10)
2
12
 
3
13
  - Fixed error with Rice 4.5
data/NOTICE.txt CHANGED
@@ -1,5 +1,5 @@
1
- Copyright 2010-2021 Google LLC
2
- Copyright 2020-2022 Andrew Kane
1
+ Copyright 2010-2025 Google LLC
2
+ Copyright 2020-2025 Andrew Kane
3
3
 
4
4
  Licensed under the Apache License, Version 2.0 (the "License");
5
5
  you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  #include <ortools/graph/assignment.h>
2
-
3
- #include "ext.h"
2
+ #include <rice/rice.hpp>
3
+ #include <rice/stl.hpp>
4
4
 
5
5
  using operations_research::SimpleLinearSumAssignment;
6
6
 
@@ -1,6 +1,9 @@
1
- #include <ortools/algorithms/knapsack_solver.h>
1
+ #include <string>
2
+ #include <vector>
2
3
 
3
- #include "ext.h"
4
+ #include <ortools/algorithms/knapsack_solver.h>
5
+ #include <rice/rice.hpp>
6
+ #include <rice/stl.hpp>
4
7
 
5
8
  using operations_research::KnapsackSolver;
6
9
 
@@ -8,22 +11,18 @@ using Rice::Array;
8
11
  using Rice::Object;
9
12
  using Rice::Symbol;
10
13
 
11
- namespace Rice::detail
12
- {
14
+ namespace Rice::detail {
13
15
  template<>
14
- struct Type<KnapsackSolver::SolverType>
15
- {
16
+ struct Type<KnapsackSolver::SolverType> {
16
17
  static bool verify() { return true; }
17
18
  };
18
19
 
19
20
  template<>
20
- class From_Ruby<KnapsackSolver::SolverType>
21
- {
21
+ class From_Ruby<KnapsackSolver::SolverType> {
22
22
  public:
23
23
  Convertible is_convertible(VALUE value) { return Convertible::Cast; }
24
24
 
25
- KnapsackSolver::SolverType convert(VALUE x)
26
- {
25
+ KnapsackSolver::SolverType convert(VALUE x) {
27
26
  auto s = Symbol(x).str();
28
27
  if (s == "branch_and_bound") {
29
28
  return KnapsackSolver::KNAPSACK_MULTIDIMENSION_BRANCH_AND_BOUND_SOLVER;
@@ -32,7 +31,7 @@ namespace Rice::detail
32
31
  }
33
32
  }
34
33
  };
35
- }
34
+ } // namespace Rice::detail
36
35
 
37
36
  void init_bin_packing(Rice::Module& m) {
38
37
  Rice::define_class_under<KnapsackSolver>(m, "KnapsackSolver")
@@ -1,7 +1,10 @@
1
+ #include <string>
2
+ #include <vector>
3
+
1
4
  #include <google/protobuf/text_format.h>
2
5
  #include <ortools/sat/cp_model.h>
3
-
4
- #include "ext.h"
6
+ #include <rice/rice.hpp>
7
+ #include <rice/stl.hpp>
5
8
 
6
9
  using operations_research::Domain;
7
10
  using operations_research::sat::BoolVar;
@@ -27,22 +30,18 @@ using Rice::Symbol;
27
30
  Class rb_cBoolVar;
28
31
  Class rb_cSatIntVar;
29
32
 
30
- namespace Rice::detail
31
- {
33
+ namespace Rice::detail {
32
34
  template<>
33
- struct Type<LinearExpr>
34
- {
35
+ struct Type<LinearExpr> {
35
36
  static bool verify() { return true; }
36
37
  };
37
38
 
38
39
  template<>
39
- class From_Ruby<LinearExpr>
40
- {
40
+ class From_Ruby<LinearExpr> {
41
41
  public:
42
42
  Convertible is_convertible(VALUE value) { return Convertible::Cast; }
43
43
 
44
- LinearExpr convert(VALUE v)
45
- {
44
+ LinearExpr convert(VALUE v) {
46
45
  LinearExpr expr;
47
46
 
48
47
  Rice::Object utils = Rice::define_module("ORTools").const_get("Utils");
@@ -64,7 +63,7 @@ namespace Rice::detail
64
63
  return expr;
65
64
  }
66
65
  };
67
- }
66
+ } // namespace Rice::detail
68
67
 
69
68
  void init_constraint(Rice::Module& m) {
70
69
  Rice::define_class_under<Domain>(m, "Domain")
data/ext/or-tools/ext.cpp CHANGED
@@ -1,7 +1,7 @@
1
1
  #include <ortools/base/version.h>
2
2
  #include <ortools/init/init.h>
3
-
4
- #include "ext.h"
3
+ #include <rice/rice.hpp>
4
+ #include <rice/stl.hpp>
5
5
 
6
6
  using operations_research::CppBridge;
7
7
  using operations_research::CppFlags;
@@ -15,8 +15,7 @@ void init_network_flows(Rice::Module& m);
15
15
  void init_routing(Rice::Module& m);
16
16
 
17
17
  extern "C"
18
- void Init_ext()
19
- {
18
+ void Init_ext() {
20
19
  auto m = Rice::define_module("ORTools");
21
20
 
22
21
  m.define_singleton_function("lib_version", &operations_research::OrToolsVersionString);
@@ -1,6 +1,6 @@
1
1
  require "mkmf-rice"
2
2
 
3
- $CXXFLAGS << " -std=c++17 $(optflags) -DUSE_CBC"
3
+ $CXXFLAGS << " -std=c++17 $(optflags) -DUSE_CBC -DOR_PROTO_DLL="
4
4
 
5
5
  # show warnings
6
6
  $CXXFLAGS << " -Wall -Wextra"
@@ -32,10 +32,7 @@ end
32
32
  # find_header and find_library first check without adding path
33
33
  # which can cause them to find system library
34
34
  $INCFLAGS << " -I#{inc}"
35
- # could support shared libraries for protobuf and abseil
36
- # but keep simple for now
37
- raise "libprotobuf.a not found" unless File.exist?("#{lib}/libprotobuf.a")
38
- $LDFLAGS.prepend("-Wl,-rpath,#{rpath} -L#{lib} #{lib}/libprotobuf.a ")
35
+ $LDFLAGS.prepend("-Wl,-rpath,#{rpath} -L#{lib} ")
39
36
  raise "OR-Tools not found" unless have_library("ortools")
40
37
 
41
38
  create_makefile("or_tools/ext")
@@ -1,6 +1,9 @@
1
- #include <ortools/linear_solver/linear_solver.h>
1
+ #include <memory>
2
+ #include <string>
2
3
 
3
- #include "ext.h"
4
+ #include <ortools/linear_solver/linear_solver.h>
5
+ #include <rice/rice.hpp>
6
+ #include <rice/stl.hpp>
4
7
 
5
8
  using operations_research::MPConstraint;
6
9
  using operations_research::MPObjective;
@@ -15,21 +18,17 @@ using Rice::Object;
15
18
  using Rice::String;
16
19
  using Rice::Symbol;
17
20
 
18
- namespace Rice::detail
19
- {
21
+ namespace Rice::detail {
20
22
  template<>
21
- struct Type<MPSolver::OptimizationProblemType>
22
- {
23
+ struct Type<MPSolver::OptimizationProblemType> {
23
24
  static bool verify() { return true; }
24
25
  };
25
26
 
26
27
  template<>
27
- struct From_Ruby<MPSolver::OptimizationProblemType>
28
- {
28
+ struct From_Ruby<MPSolver::OptimizationProblemType> {
29
29
  Convertible is_convertible(VALUE value) { return Convertible::Cast; }
30
30
 
31
- static MPSolver::OptimizationProblemType convert(VALUE x)
32
- {
31
+ static MPSolver::OptimizationProblemType convert(VALUE x) {
33
32
  auto s = Symbol(x).str();
34
33
  if (s == "glop") {
35
34
  return MPSolver::OptimizationProblemType::GLOP_LINEAR_PROGRAMMING;
@@ -40,7 +39,7 @@ namespace Rice::detail
40
39
  }
41
40
  }
42
41
  };
43
- }
42
+ } // namespace Rice::detail
44
43
 
45
44
  void init_linear(Rice::Module& m) {
46
45
  Rice::define_class_under<MPVariable>(m, "MPVariable")
@@ -1,9 +1,11 @@
1
- #include "absl/log/check.h"
2
- #include "absl/status/statusor.h"
3
- #include "ortools/base/init_google.h"
4
- #include "ortools/math_opt/cpp/math_opt.h"
1
+ #include <string>
5
2
 
6
- #include "ext.h"
3
+ #include <absl/log/check.h>
4
+ #include <absl/status/statusor.h>
5
+ #include <ortools/base/init_google.h>
6
+ #include <ortools/math_opt/cpp/math_opt.h>
7
+ #include <rice/rice.hpp>
8
+ #include <rice/stl.hpp>
7
9
 
8
10
  using operations_research::math_opt::LinearConstraint;
9
11
  using operations_research::math_opt::Model;
@@ -15,21 +17,17 @@ using operations_research::math_opt::Termination;
15
17
  using operations_research::math_opt::TerminationReason;
16
18
  using operations_research::math_opt::Variable;
17
19
 
18
- namespace Rice::detail
19
- {
20
+ namespace Rice::detail {
20
21
  template<>
21
- struct Type<SolverType>
22
- {
22
+ struct Type<SolverType> {
23
23
  static bool verify() { return true; }
24
24
  };
25
25
 
26
26
  template<>
27
- struct From_Ruby<SolverType>
28
- {
27
+ struct From_Ruby<SolverType> {
29
28
  Convertible is_convertible(VALUE value) { return Convertible::Cast; }
30
29
 
31
- static SolverType convert(VALUE x)
32
- {
30
+ static SolverType convert(VALUE x) {
33
31
  auto s = Symbol(x).str();
34
32
  if (s == "gscip") {
35
33
  return SolverType::kGscip;
@@ -56,7 +54,7 @@ namespace Rice::detail
56
54
  }
57
55
  }
58
56
  };
59
- }
57
+ } // namespace Rice::detail
60
58
 
61
59
  void init_math_opt(Rice::Module& m) {
62
60
  auto mathopt = Rice::define_module_under(m, "MathOpt");
@@ -67,7 +65,7 @@ void init_math_opt(Rice::Module& m) {
67
65
  .define_method(
68
66
  "_eql?",
69
67
  [](Variable& self, Variable &other) {
70
- return (bool) (self == other);
68
+ return static_cast<bool>(self == other);
71
69
  });
72
70
 
73
71
  Rice::define_class_under<LinearConstraint>(mathopt, "LinearConstraint");
@@ -1,7 +1,9 @@
1
+ #include <vector>
2
+
1
3
  #include <ortools/graph/max_flow.h>
2
4
  #include <ortools/graph/min_cost_flow.h>
3
-
4
- #include "ext.h"
5
+ #include <rice/rice.hpp>
6
+ #include <rice/stl.hpp>
5
7
 
6
8
  using operations_research::NodeIndex;
7
9
  using operations_research::SimpleMaxFlow;
@@ -1,7 +1,10 @@
1
+ #include <string>
2
+ #include <vector>
3
+
1
4
  #include <ortools/constraint_solver/routing.h>
2
5
  #include <ortools/constraint_solver/routing_parameters.h>
3
-
4
- #include "ext.h"
6
+ #include <rice/rice.hpp>
7
+ #include <rice/stl.hpp>
5
8
 
6
9
  using operations_research::Assignment;
7
10
  using operations_research::ConstraintSolverParameters;
@@ -15,6 +18,7 @@ using operations_research::RoutingModel;
15
18
  using operations_research::RoutingModelParameters;
16
19
  using operations_research::RoutingNodeIndex;
17
20
  using operations_research::RoutingSearchParameters;
21
+ using operations_research::RoutingSearchStatus;
18
22
 
19
23
  using Rice::Array;
20
24
  using Rice::Class;
@@ -23,37 +27,31 @@ using Rice::Object;
23
27
  using Rice::String;
24
28
  using Rice::Symbol;
25
29
 
26
- namespace Rice::detail
27
- {
30
+ namespace Rice::detail {
28
31
  template<>
29
- struct Type<RoutingNodeIndex>
30
- {
32
+ struct Type<RoutingNodeIndex> {
31
33
  static bool verify() { return true; }
32
34
  };
33
35
 
34
36
  template<>
35
- class From_Ruby<RoutingNodeIndex>
36
- {
37
+ class From_Ruby<RoutingNodeIndex> {
37
38
  public:
38
39
  Convertible is_convertible(VALUE value) { return Convertible::Cast; }
39
40
 
40
- RoutingNodeIndex convert(VALUE x)
41
- {
41
+ RoutingNodeIndex convert(VALUE x) {
42
42
  const RoutingNodeIndex index{From_Ruby<int>().convert(x)};
43
43
  return index;
44
44
  }
45
45
  };
46
46
 
47
47
  template<>
48
- class To_Ruby<RoutingNodeIndex>
49
- {
48
+ class To_Ruby<RoutingNodeIndex> {
50
49
  public:
51
- VALUE convert(RoutingNodeIndex const & x)
52
- {
50
+ VALUE convert(RoutingNodeIndex const & x) {
53
51
  return To_Ruby<int>().convert(x.value());
54
52
  }
55
53
  };
56
- }
54
+ } // namespace Rice::detail
57
55
 
58
56
  void init_routing(Rice::Module& m) {
59
57
  auto rb_cRoutingSearchParameters = Rice::define_class_under<RoutingSearchParameters>(m, "RoutingSearchParameters");
@@ -252,7 +250,11 @@ void init_routing(Rice::Module& m) {
252
250
  })
253
251
  .define_method(
254
252
  "cumulative",
255
- [](operations_research::Solver& self, std::vector<operations_research::IntervalVar*> intervals, std::vector<int64_t> demands, int64_t capacity, const std::string& name) {
253
+ [](operations_research::Solver& self, Array rb_intervals, std::vector<int64_t> demands, int64_t capacity, const std::string& name) {
254
+ std::vector<operations_research::IntervalVar*> intervals;
255
+ for (const Object v : rb_intervals) {
256
+ intervals.push_back(Rice::detail::From_Ruby<operations_research::IntervalVar*>().convert(v.value()));
257
+ }
256
258
  return self.MakeCumulative(intervals, demands, capacity, name);
257
259
  });
258
260
 
@@ -331,7 +333,7 @@ void init_routing(Rice::Module& m) {
331
333
  .define_method("add_resource_group", &RoutingModel::AddResourceGroup)
332
334
  .define_method("dimension_resource_group_indices", &RoutingModel::GetDimensionResourceGroupIndices)
333
335
  .define_method("dimension_resource_group_index", &RoutingModel::GetDimensionResourceGroupIndex)
334
- .define_method("add_disjunction", &RoutingModel::AddDisjunction, Rice::Arg("_indices"), Rice::Arg("_penalty"), Rice::Arg("_max_cardinality") = (int64_t)1)
336
+ .define_method("add_disjunction", &RoutingModel::AddDisjunction, Rice::Arg("_indices"), Rice::Arg("_penalty"), Rice::Arg("_max_cardinality") = static_cast<int64_t>(1), Rice::Arg("_penalty_cost_behavior") = RoutingModel::PenaltyCostBehavior::PENALIZE_ONCE)
335
337
  .define_method("disjunction_indices", &RoutingModel::GetDisjunctionIndices)
336
338
  .define_method("disjunction_penalty", &RoutingModel::GetDisjunctionPenalty)
337
339
  .define_method("disjunction_max_cardinality", &RoutingModel::GetDisjunctionMaxCardinality)
@@ -346,22 +348,14 @@ void init_routing(Rice::Module& m) {
346
348
  .define_method("add_pickup_and_delivery", &RoutingModel::AddPickupAndDelivery)
347
349
  .define_method("add_pickup_and_delivery_sets", &RoutingModel::AddPickupAndDeliverySets)
348
350
  .define_method(
349
- "pickup_positions",
351
+ "pickup_position",
350
352
  [](RoutingModel& self, int64_t node_index) {
351
- std::vector<std::pair<int, int>> positions;
352
- for (const auto& v : self.GetPickupPositions(node_index)) {
353
- positions.emplace_back(v.pd_pair_index, v.alternative_index);
354
- }
355
- return positions;
353
+ return self.GetPickupPosition(node_index);
356
354
  })
357
355
  .define_method(
358
- "delivery_positions",
356
+ "delivery_position",
359
357
  [](RoutingModel& self, int64_t node_index) {
360
- std::vector<std::pair<int, int>> positions;
361
- for (const auto& v : self.GetDeliveryPositions(node_index)) {
362
- positions.emplace_back(v.pd_pair_index, v.alternative_index);
363
- }
364
- return positions;
358
+ return self.GetDeliveryPosition(node_index);
365
359
  })
366
360
  .define_method("num_of_singleton_nodes", &RoutingModel::GetNumOfSingletonNodes)
367
361
  .define_method("unperformed_penalty", &RoutingModel::UnperformedPenalty)
@@ -403,15 +397,15 @@ void init_routing(Rice::Module& m) {
403
397
  [](RoutingModel& self) {
404
398
  auto status = self.status();
405
399
 
406
- if (status == RoutingModel::ROUTING_NOT_SOLVED) {
400
+ if (status == RoutingSearchStatus::ROUTING_NOT_SOLVED) {
407
401
  return Symbol("not_solved");
408
- } else if (status == RoutingModel::ROUTING_SUCCESS) {
402
+ } else if (status == RoutingSearchStatus::ROUTING_SUCCESS) {
409
403
  return Symbol("success");
410
- } else if (status == RoutingModel::ROUTING_FAIL) {
404
+ } else if (status == RoutingSearchStatus::ROUTING_FAIL) {
411
405
  return Symbol("fail");
412
- } else if (status == RoutingModel::ROUTING_FAIL_TIMEOUT) {
406
+ } else if (status == RoutingSearchStatus::ROUTING_FAIL_TIMEOUT) {
413
407
  return Symbol("fail_timeout");
414
- } else if (status == RoutingModel::ROUTING_INVALID) {
408
+ } else if (status == RoutingSearchStatus::ROUTING_INVALID) {
415
409
  return Symbol("invalid");
416
410
  } else {
417
411
  throw std::runtime_error("Unknown solver status");
@@ -3,18 +3,18 @@ require "fileutils"
3
3
  require "net/http"
4
4
  require "tmpdir"
5
5
 
6
- version = "9.11.4210"
6
+ version = "9.12.4544"
7
7
 
8
8
  arch = RbConfig::CONFIG["host_cpu"]
9
9
  arm = arch.match?(/arm|aarch64/i)
10
10
 
11
11
  if RbConfig::CONFIG["host_os"].match?(/darwin/i)
12
12
  if arm
13
- filename = "or-tools_arm64_macOS-14.6.1_cpp_v#{version}.tar.gz"
14
- checksum = "a106668eb1975c1672874ef24b4f8e2e56669467a63349e5ea8ef5419814c31b"
13
+ filename = "or-tools_arm64_macOS-15.3.1_cpp_v#{version}.tar.gz"
14
+ checksum = "02f89e54bd8d86e6e069f843aeed10a444ff329052e5a7fd732c5e4ec4f845fb"
15
15
  else
16
- filename = "or-tools_x86_64_macOS-14.6.1_cpp_v#{version}.tar.gz"
17
- checksum = "cc87a7f8c68ec4fed6c6de6565b0b625f2f0047185a8a4449ef4b5a305b60e55"
16
+ filename = "or-tools_x86_64_macOS-15.3.1_cpp_v#{version}.tar.gz"
17
+ checksum = "515af60e73e7fa620bab7f4a7d60b9069075d814453d91906aa39993d714f28d"
18
18
  end
19
19
  else
20
20
  # try /etc/os-release with fallback to /usr/lib/os-release
@@ -29,22 +29,22 @@ else
29
29
 
30
30
  if os == "ubuntu" && os_version == "24.04" && !arm
31
31
  filename = "or-tools_amd64_ubuntu-24.04_cpp_v#{version}.tar.gz"
32
- checksum = "71761d93171b111fca736647a6cd00cb9e606474df597a8b48f3f5f2c73d4c0f"
32
+ checksum = "71128e095024707bf9835faf4558cbe34acb79345e899bd532f3008a493a8970"
33
33
  elsif os == "ubuntu" && os_version == "22.04" && !arm
34
34
  filename = "or-tools_amd64_ubuntu-22.04_cpp_v#{version}.tar.gz"
35
- checksum = "f613574d4eae01afd966c8bde199990cbd9fad46035e675d71f17f5c7477eed4"
35
+ checksum = "cb42ea7d7799a01fea7cdaafacbdfc67180d85f39532c6d2a8c4cfb419bd07ed"
36
36
  elsif os == "ubuntu" && os_version == "20.04" && !arm
37
37
  filename = "or-tools_amd64_ubuntu-20.04_cpp_v#{version}.tar.gz"
38
- checksum = "190b85f4510cab55fcb50b9850a0e2f94b2bdf5e266580650efbc5aaab760683"
38
+ checksum = "ea51589fe80bd9cd4fb6203bd1e956b311cdb1d21bbd14f7b6dad75c81d3583c"
39
39
  elsif os == "debian" && os_version == "11" && !arm
40
40
  filename = "or-tools_amd64_debian-11_cpp_v#{version}.tar.gz"
41
- checksum = "a8354696f365aa13a2375da5f8f6cfd8785430681addcd887bfd194851dd4710"
41
+ checksum = "dcee63b726569bd99c134e0e920173f955feae5856c3370a0bed03fdc995af50"
42
42
  elsif os == "debian" && os_version == "12" && !arm
43
43
  filename = "or-tools_amd64_debian-12_cpp_v#{version}.tar.gz"
44
- checksum = "9fda332f2f9d3b5647d85dd65de145ea3e2a1543714bf588f82da8ec57721cbf"
44
+ checksum = "911143f50fe013fbd50d0dce460512106596adfc0f2ad9a2bc8afd218531bde4"
45
45
  elsif os == "arch" && !arm
46
46
  filename = "or-tools_amd64_archlinux_cpp_v#{version}.tar.gz"
47
- checksum = "ac892a949d871294b7e26b0730440ab8629b4021bf3c1641bc7c8fb09b45081f"
47
+ checksum = "18c1d929e2144e9d9602659ea2fa790bd2a150f72c32c38a97f571839816d132"
48
48
  else
49
49
  platform =
50
50
  if Gem.win_platform?
@@ -132,22 +132,17 @@ Dir.mktmpdir do |extract_path|
132
132
  raise "License not found" unless license_files.any?
133
133
  license_files.each do |file|
134
134
  FileUtils.mkdir_p(File.join(path, File.dirname(file)))
135
- FileUtils.cp(File.join(extract_path, file), File.join(path, file))
135
+ FileUtils.mv(File.join(extract_path, file), File.join(path, file))
136
136
  end
137
137
 
138
138
  # include
139
- FileUtils.cp_r(File.join(extract_path, "include"), File.join(path, "include"))
139
+ FileUtils.mv(File.join(extract_path, "include"), File.join(path, "include"))
140
140
 
141
141
  # shared library
142
142
  FileUtils.mkdir(File.join(path, "lib"))
143
- Dir.glob("lib/libortools.{9.dylib,so.9}", base: extract_path) do |file|
144
- so_path = File.join(path, file)
145
- FileUtils.cp(File.join(extract_path, file), so_path)
146
- ext = file.end_with?(".dylib") ? "dylib" : "so"
147
- File.symlink(so_path, File.join(path, "lib/libortools.#{ext}"))
148
- end
149
- ["lib/libprotobuf.a"].each do |file|
150
- FileUtils.cp(File.join(extract_path, file), File.join(path, file))
143
+ Dir.glob("lib/lib*{.dylib,.so,.so.*}", base: extract_path) do |file|
144
+ next if file.include?("libprotoc.")
145
+ FileUtils.mv(File.join(extract_path, file), File.join(path, file))
151
146
  end
152
147
  end
153
148
 
@@ -1,9 +1,13 @@
1
1
  module ORTools
2
2
  class RoutingModel
3
- def solve(solution_limit: nil, time_limit: nil, lns_time_limit: nil,
4
- first_solution_strategy: nil, local_search_metaheuristic: nil,
5
- log_search: nil)
6
-
3
+ def solve(
4
+ solution_limit: nil,
5
+ time_limit: nil,
6
+ lns_time_limit: nil,
7
+ first_solution_strategy: nil,
8
+ local_search_metaheuristic: nil,
9
+ log_search: nil
10
+ )
7
11
  search_parameters = ORTools.default_routing_search_parameters
8
12
  search_parameters.solution_limit = solution_limit if solution_limit
9
13
  search_parameters.time_limit = time_limit if time_limit
@@ -13,9 +17,5 @@ module ORTools
13
17
  search_parameters.log_search = log_search unless log_search.nil?
14
18
  solve_with_parameters(search_parameters)
15
19
  end
16
-
17
- # previous names
18
- alias_method :pickup_index_pairs, :pickup_positions
19
- alias_method :delivery_index_pairs, :delivery_positions
20
20
  end
21
21
  end
@@ -1,3 +1,3 @@
1
1
  module ORTools
2
- VERSION = "0.14.2"
2
+ VERSION = "0.15.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: or-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.2
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-10 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rice
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '4.5'
18
+ version: 4.5.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '4.5'
25
+ version: 4.5.0
26
26
  email: andrew@ankane.org
27
27
  executables: []
28
28
  extensions:
@@ -37,7 +37,6 @@ files:
37
37
  - ext/or-tools/bin_packing.cpp
38
38
  - ext/or-tools/constraint.cpp
39
39
  - ext/or-tools/ext.cpp
40
- - ext/or-tools/ext.h
41
40
  - ext/or-tools/extconf.rb
42
41
  - ext/or-tools/linear.cpp
43
42
  - ext/or-tools/math_opt.cpp
@@ -86,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
85
  - !ruby/object:Gem::Version
87
86
  version: '0'
88
87
  requirements: []
89
- rubygems_version: 3.6.2
88
+ rubygems_version: 3.6.7
90
89
  specification_version: 4
91
90
  summary: Operations research tools for Ruby
92
91
  test_files: []
data/ext/or-tools/ext.h DELETED
@@ -1,4 +0,0 @@
1
- #pragma once
2
-
3
- #include <rice/rice.hpp>
4
- #include <rice/stl.hpp>