rulp 0.0.34 → 0.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/solvers/glpk.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90c0920b51f974fa7b72d116b7f947f641611b9a
|
4
|
+
data.tar.gz: 45250d704438bab16313f9216097fa35f50470a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1808ae9c9d425dbd55f0a33a08f5d0a2b699756bc42bf976a6bdb953ff150aa2f84caedcc49350149b51eb52439504ecb50e1b03b4de7fb06d1cf9ad40f66de7
|
7
|
+
data.tar.gz: c78c8b088a4627da7323413c68c7e5cb7e52d0a5ea38895092c32824b6c9464412ef0298fd58c68f490a28d952880d7c9589938231175836c2cacfb9abd5d5f4
|
data/lib/solvers/glpk.rb
CHANGED
@@ -13,9 +13,13 @@ class Glpk < Solver
|
|
13
13
|
rows = IO.read(@outfile).split("\n")
|
14
14
|
objective_str = rows[5].split(/\s+/)[-2]
|
15
15
|
vars_by_name = {}
|
16
|
+
cols = []
|
16
17
|
rows[1..-1].each do |row|
|
17
|
-
cols
|
18
|
-
|
18
|
+
cols.concat(row.strip.split(/\s+/))
|
19
|
+
if cols.length > 4
|
20
|
+
vars_by_name[cols[1].to_s] = cols[3].to_f
|
21
|
+
cols = []
|
22
|
+
end
|
19
23
|
end
|
20
24
|
variables.each do |var|
|
21
25
|
var.value = vars_by_name[var.to_s].to_f
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rulp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wouter Coppieters
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple Ruby LP description DSL
|
14
14
|
email: wc@pico.net.nz
|