rulp 0.0.34 → 0.0.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/solvers/glpk.rb +6 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bba7ca32b2b626745aab95c69ea44739505eb69
4
- data.tar.gz: b860a1717f0eabc4209e2b4aeacc75e0e3bef656
3
+ metadata.gz: 90c0920b51f974fa7b72d116b7f947f641611b9a
4
+ data.tar.gz: 45250d704438bab16313f9216097fa35f50470a8
5
5
  SHA512:
6
- metadata.gz: 509e3d0965ab38569e412293ed1cd5c4a7f9fc164f83e5b3540eb93f772ccff9e70fe106c42595fe53d58a9e5e146a7a2affe07d3fd905d3958297cd6457a96d
7
- data.tar.gz: ccf7da341e7898bd4aeef9253fc4f2efa5aa019bbc7085a9bd0949ac9e245457faf93fc1f029b3ac5355a3cb310b15147603c4ca037f8b48c094157ce5e1642d
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 = row.strip.split(/\s+/)
18
- vars_by_name[cols[1].to_s] = cols[3].to_f
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.34
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-18 00:00:00.000000000 Z
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