or-tools 0.14.1 → 0.14.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/ext/or-tools/bin_packing.cpp +3 -4
- data/ext/or-tools/constraint.cpp +3 -4
- data/ext/or-tools/extconf.rb +1 -1
- data/ext/or-tools/linear.cpp +24 -7
- data/ext/or-tools/math_opt.cpp +3 -4
- data/ext/or-tools/routing.cpp +7 -8
- data/lib/or_tools/version.rb +1 -1
- metadata +5 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2974585825c8e1f3d50aabc494131861eef79c80468a889537f58b2dd3926be
|
4
|
+
data.tar.gz: 5f9b8fe4574a30ebea1fba0b53a91475683e68fe5e535ba99047a6f2b3a16173
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48fc84cebe3a922044a98909dd8b06d61712ea1bdf06014b99a0a92dd4406766facd99cd3f2c99425257642ef08ad5a489d9ee87f354cf7f5d16a3d7ff306d5e
|
7
|
+
data.tar.gz: 6edc981eb8b47f716f607be3e7c28a59c49076810a7fcbda7077fcc3a1abcf420fe58c17d372a40447f435e7abfd68879fc471b0c8c86afdd4d1610786b0489e
|
data/CHANGELOG.md
CHANGED
@@ -13,16 +13,15 @@ namespace Rice::detail
|
|
13
13
|
template<>
|
14
14
|
struct Type<KnapsackSolver::SolverType>
|
15
15
|
{
|
16
|
-
static bool verify()
|
17
|
-
{
|
18
|
-
return true;
|
19
|
-
}
|
16
|
+
static bool verify() { return true; }
|
20
17
|
};
|
21
18
|
|
22
19
|
template<>
|
23
20
|
class From_Ruby<KnapsackSolver::SolverType>
|
24
21
|
{
|
25
22
|
public:
|
23
|
+
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
24
|
+
|
26
25
|
KnapsackSolver::SolverType convert(VALUE x)
|
27
26
|
{
|
28
27
|
auto s = Symbol(x).str();
|
data/ext/or-tools/constraint.cpp
CHANGED
@@ -32,16 +32,15 @@ namespace Rice::detail
|
|
32
32
|
template<>
|
33
33
|
struct Type<LinearExpr>
|
34
34
|
{
|
35
|
-
static bool verify()
|
36
|
-
{
|
37
|
-
return true;
|
38
|
-
}
|
35
|
+
static bool verify() { return true; }
|
39
36
|
};
|
40
37
|
|
41
38
|
template<>
|
42
39
|
class From_Ruby<LinearExpr>
|
43
40
|
{
|
44
41
|
public:
|
42
|
+
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
43
|
+
|
45
44
|
LinearExpr convert(VALUE v)
|
46
45
|
{
|
47
46
|
LinearExpr expr;
|
data/ext/or-tools/extconf.rb
CHANGED
@@ -9,7 +9,7 @@ $CXXFLAGS << " -Wall -Wextra"
|
|
9
9
|
$CXXFLAGS << " -Wno-sign-compare -Wno-ignored-qualifiers -Wno-unused-parameter -Wno-missing-field-initializers"
|
10
10
|
|
11
11
|
# hide Rice warnings
|
12
|
-
$CXXFLAGS << " -Wno-implicit-fallthrough"
|
12
|
+
$CXXFLAGS << " -Wno-unused-private-field -Wno-implicit-fallthrough"
|
13
13
|
|
14
14
|
inc, lib = dir_config("or-tools")
|
15
15
|
if inc || lib
|
data/ext/or-tools/linear.cpp
CHANGED
@@ -20,15 +20,14 @@ namespace Rice::detail
|
|
20
20
|
template<>
|
21
21
|
struct Type<MPSolver::OptimizationProblemType>
|
22
22
|
{
|
23
|
-
static bool verify()
|
24
|
-
{
|
25
|
-
return true;
|
26
|
-
}
|
23
|
+
static bool verify() { return true; }
|
27
24
|
};
|
28
25
|
|
29
26
|
template<>
|
30
27
|
struct From_Ruby<MPSolver::OptimizationProblemType>
|
31
28
|
{
|
29
|
+
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
30
|
+
|
32
31
|
static MPSolver::OptimizationProblemType convert(VALUE x)
|
33
32
|
{
|
34
33
|
auto s = Symbol(x).str();
|
@@ -108,7 +107,13 @@ void init_linear(Rice::Module& m) {
|
|
108
107
|
"presolve",
|
109
108
|
[](MPSolverParameters& self) {
|
110
109
|
int presolve = self.GetIntegerParam(MPSolverParameters::IntegerParam::PRESOLVE);
|
111
|
-
|
110
|
+
if (presolve == MPSolverParameters::PresolveValues::PRESOLVE_ON) {
|
111
|
+
return Rice::True;
|
112
|
+
} else if (presolve == MPSolverParameters::PresolveValues::PRESOLVE_OFF) {
|
113
|
+
return Rice::False;
|
114
|
+
} else {
|
115
|
+
return Rice::Nil;
|
116
|
+
}
|
112
117
|
})
|
113
118
|
.define_method(
|
114
119
|
"incrementality=",
|
@@ -125,7 +130,13 @@ void init_linear(Rice::Module& m) {
|
|
125
130
|
"incrementality",
|
126
131
|
[](MPSolverParameters& self) {
|
127
132
|
int incrementality = self.GetIntegerParam(MPSolverParameters::IntegerParam::INCREMENTALITY);
|
128
|
-
|
133
|
+
if (incrementality == MPSolverParameters::IncrementalityValues::INCREMENTALITY_ON) {
|
134
|
+
return Rice::True;
|
135
|
+
} else if (incrementality == MPSolverParameters::IncrementalityValues::INCREMENTALITY_OFF) {
|
136
|
+
return Rice::False;
|
137
|
+
} else {
|
138
|
+
return Rice::Nil;
|
139
|
+
}
|
129
140
|
})
|
130
141
|
.define_method(
|
131
142
|
"scaling=",
|
@@ -142,7 +153,13 @@ void init_linear(Rice::Module& m) {
|
|
142
153
|
"scaling",
|
143
154
|
[](MPSolverParameters& self) {
|
144
155
|
int scaling = self.GetIntegerParam(MPSolverParameters::IntegerParam::SCALING);
|
145
|
-
|
156
|
+
if (scaling == MPSolverParameters::ScalingValues::SCALING_ON) {
|
157
|
+
return Rice::True;
|
158
|
+
} else if (scaling == MPSolverParameters::ScalingValues::SCALING_OFF) {
|
159
|
+
return Rice::False;
|
160
|
+
} else {
|
161
|
+
return Rice::Nil;
|
162
|
+
}
|
146
163
|
});
|
147
164
|
|
148
165
|
Rice::define_class_under<MPSolver>(m, "Solver")
|
data/ext/or-tools/math_opt.cpp
CHANGED
@@ -20,15 +20,14 @@ namespace Rice::detail
|
|
20
20
|
template<>
|
21
21
|
struct Type<SolverType>
|
22
22
|
{
|
23
|
-
static bool verify()
|
24
|
-
{
|
25
|
-
return true;
|
26
|
-
}
|
23
|
+
static bool verify() { return true; }
|
27
24
|
};
|
28
25
|
|
29
26
|
template<>
|
30
27
|
struct From_Ruby<SolverType>
|
31
28
|
{
|
29
|
+
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
30
|
+
|
32
31
|
static SolverType convert(VALUE x)
|
33
32
|
{
|
34
33
|
auto s = Symbol(x).str();
|
data/ext/or-tools/routing.cpp
CHANGED
@@ -28,16 +28,15 @@ namespace Rice::detail
|
|
28
28
|
template<>
|
29
29
|
struct Type<RoutingNodeIndex>
|
30
30
|
{
|
31
|
-
static bool verify()
|
32
|
-
{
|
33
|
-
return true;
|
34
|
-
}
|
31
|
+
static bool verify() { return true; }
|
35
32
|
};
|
36
33
|
|
37
34
|
template<>
|
38
35
|
class From_Ruby<RoutingNodeIndex>
|
39
36
|
{
|
40
37
|
public:
|
38
|
+
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
|
39
|
+
|
41
40
|
RoutingNodeIndex convert(VALUE x)
|
42
41
|
{
|
43
42
|
const RoutingNodeIndex index{From_Ruby<int>().convert(x)};
|
@@ -285,7 +284,7 @@ void init_routing(Rice::Module& m) {
|
|
285
284
|
Rice::define_class_under<RoutingModel::ResourceGroup>(m, "ResourceGroup");
|
286
285
|
|
287
286
|
Rice::define_class_under<RoutingModel>(m, "RoutingModel")
|
288
|
-
.define_constructor(Rice::Constructor<RoutingModel, RoutingIndexManager, RoutingModelParameters>(), Rice::Arg("
|
287
|
+
.define_constructor(Rice::Constructor<RoutingModel, RoutingIndexManager, RoutingModelParameters>(), Rice::Arg("_index_manager"), Rice::Arg("_parameters") = operations_research::DefaultRoutingModelParameters())
|
289
288
|
.define_method("register_unary_transit_vector", &RoutingModel::RegisterUnaryTransitVector)
|
290
289
|
.define_method(
|
291
290
|
"register_unary_transit_callback",
|
@@ -300,7 +299,7 @@ void init_routing(Rice::Module& m) {
|
|
300
299
|
return Rice::detail::From_Ruby<int64_t>().convert(callback.call("call", from_index));
|
301
300
|
}
|
302
301
|
);
|
303
|
-
}, Rice::Arg("
|
302
|
+
}, Rice::Arg("_callback").keepAlive())
|
304
303
|
.define_method("register_transit_matrix", &RoutingModel::RegisterTransitMatrix)
|
305
304
|
.define_method(
|
306
305
|
"register_transit_callback",
|
@@ -315,7 +314,7 @@ void init_routing(Rice::Module& m) {
|
|
315
314
|
return Rice::detail::From_Ruby<int64_t>().convert(callback.call("call", from_index, to_index));
|
316
315
|
}
|
317
316
|
);
|
318
|
-
}, Rice::Arg("
|
317
|
+
}, Rice::Arg("_callback").keepAlive())
|
319
318
|
.define_method("add_dimension", &RoutingModel::AddDimension)
|
320
319
|
.define_method("add_dimension_with_vehicle_transits", &RoutingModel::AddDimensionWithVehicleTransits)
|
321
320
|
.define_method("add_dimension_with_vehicle_capacity", &RoutingModel::AddDimensionWithVehicleCapacity)
|
@@ -332,7 +331,7 @@ void init_routing(Rice::Module& m) {
|
|
332
331
|
.define_method("add_resource_group", &RoutingModel::AddResourceGroup)
|
333
332
|
.define_method("dimension_resource_group_indices", &RoutingModel::GetDimensionResourceGroupIndices)
|
334
333
|
.define_method("dimension_resource_group_index", &RoutingModel::GetDimensionResourceGroupIndex)
|
335
|
-
.define_method("add_disjunction", &RoutingModel::AddDisjunction, Rice::Arg("
|
334
|
+
.define_method("add_disjunction", &RoutingModel::AddDisjunction, Rice::Arg("_indices"), Rice::Arg("_penalty"), Rice::Arg("_max_cardinality") = (int64_t)1)
|
336
335
|
.define_method("disjunction_indices", &RoutingModel::GetDisjunctionIndices)
|
337
336
|
.define_method("disjunction_penalty", &RoutingModel::GetDisjunctionPenalty)
|
338
337
|
.define_method("disjunction_max_cardinality", &RoutingModel::GetDisjunctionMaxCardinality)
|
data/lib/or_tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: or-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-10 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rice
|
@@ -16,15 +15,14 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
18
|
+
version: '4.5'
|
20
19
|
type: :runtime
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - ">="
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.
|
27
|
-
description:
|
25
|
+
version: '4.5'
|
28
26
|
email: andrew@ankane.org
|
29
27
|
executables: []
|
30
28
|
extensions:
|
@@ -74,7 +72,6 @@ homepage: https://github.com/ankane/or-tools-ruby
|
|
74
72
|
licenses:
|
75
73
|
- Apache-2.0
|
76
74
|
metadata: {}
|
77
|
-
post_install_message:
|
78
75
|
rdoc_options: []
|
79
76
|
require_paths:
|
80
77
|
- lib
|
@@ -89,8 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
86
|
- !ruby/object:Gem::Version
|
90
87
|
version: '0'
|
91
88
|
requirements: []
|
92
|
-
rubygems_version: 3.
|
93
|
-
signing_key:
|
89
|
+
rubygems_version: 3.6.2
|
94
90
|
specification_version: 4
|
95
91
|
summary: Operations research tools for Ruby
|
96
92
|
test_files: []
|