opl 2.5.2 → 2.5.3
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 +4 -4
- data/lib/opl.rb +7 -6
- data/lib/string.rb +1 -3
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fef938a40faedf2591a3fd279c08f8bbf8a191f258f049af67d643f59c352bc2
|
4
|
+
data.tar.gz: a0503b49464613cd0d388c331df774cda3120659b0755c76f3ccf01218e81f3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0cdcd508d5b5cb1e1385a90c5451cdf82b37121a2d716c5324e25746b2bc271c852389208eb55f3a4f0f16ab3e51efc401ff2f0bee93798de512da5d7549286
|
7
|
+
data.tar.gz: a8bc9492fc5baddefdca243da8baedd9bed515af67359d2bfad17493cdd49bfd5cee5c9799ce4dca4e22d34637a27fec60cad8181a90e6a70202ceb3cd26df6f
|
data/lib/opl.rb
CHANGED
@@ -471,8 +471,9 @@ class OPL
|
|
471
471
|
end
|
472
472
|
|
473
473
|
def self.sum_indices(constraint)
|
474
|
-
#pieces_to_sub = constraint.scan(/[a-z]\[\d[\d\+\-]+\]/)
|
475
|
-
pieces_to_sub = constraint.scan(/[a-z\]]\[\d[\d\+\-]+\]/)
|
474
|
+
# pieces_to_sub = constraint.scan(/[a-z]\[\d[\d\+\-]+\]/)
|
475
|
+
# pieces_to_sub = constraint.scan(/[a-z\]]\[\d[\d\+\-]+\]/)
|
476
|
+
pieces_to_sub = constraint.scan(/\[[\d\+\-]+\]/)
|
476
477
|
pieces_to_sub.each do |piece|
|
477
478
|
characters_to_sum = piece.scan(/[\d\+\-]+/)[0]
|
478
479
|
index_sum = self.sum_constants(characters_to_sum)
|
@@ -991,7 +992,7 @@ def subject_to(constraints, options=[])
|
|
991
992
|
end
|
992
993
|
vars = OPL::Helper.variables(lhs, lp)
|
993
994
|
zero_coef_vars = all_vars - vars
|
994
|
-
row = OPL::Row.new(
|
995
|
+
row = OPL::Row.new("row-#{rand(10000)}", lower_bound, upper_bound, epsilon)
|
995
996
|
row.constraint = constraint
|
996
997
|
coefs = coefs + zero_coef_vars.map{|z|0}
|
997
998
|
vars = vars + zero_coef_vars
|
@@ -1128,11 +1129,11 @@ def optimize(optimization, objective, lp)
|
|
1128
1129
|
lp.objective = lp.error_message
|
1129
1130
|
end
|
1130
1131
|
if lp.rglpk_object.status.to_s == "4"
|
1131
|
-
|
1132
|
+
puts "There is no feasible solution."
|
1132
1133
|
elsif lp.rglpk_object.status.to_s == "6"
|
1133
|
-
|
1134
|
+
puts "The solution is unbounded."
|
1134
1135
|
elsif lp.rglpk_object.status.to_s == "1"
|
1135
|
-
|
1136
|
+
puts "The solution is undefined."
|
1136
1137
|
end
|
1137
1138
|
lp
|
1138
1139
|
end
|
data/lib/string.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Godlove
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rglpk
|
@@ -40,7 +40,7 @@ homepage: http://github.com/brg8/opl
|
|
40
40
|
licenses:
|
41
41
|
- MIT
|
42
42
|
metadata: {}
|
43
|
-
post_install_message:
|
43
|
+
post_install_message:
|
44
44
|
rdoc_options: []
|
45
45
|
require_paths:
|
46
46
|
- lib
|
@@ -55,8 +55,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
requirements: []
|
58
|
-
rubygems_version: 3.0.
|
59
|
-
signing_key:
|
58
|
+
rubygems_version: 3.0.9
|
59
|
+
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Linear Or Mixed Integer Program Solver
|
62
62
|
test_files: []
|