rglpk 0.2.3 → 0.2.4

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.
data/ChangeLog.md CHANGED
@@ -1,3 +1,11 @@
1
+ # rglpk 0.2.4 2010-11-04
2
+
3
+ * Add Rglpk#mip_status.
4
+
5
+ # rglpk 0.2.3 2010-11-03
6
+
7
+ * Allow range access of rows and columns.
8
+
1
9
  # rglpk 0.2.2 2010-10-25
2
10
 
3
11
  * Exclude RDoc generation since we don't yet have any.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
data/lib/rglpk.rb CHANGED
@@ -68,7 +68,6 @@ module Rglpk
68
68
  @rows = RowArray.new
69
69
  @cols = ColArray.new
70
70
  Glpk_wrapper.glp_create_index(@lp)
71
- @status = nil
72
71
  end
73
72
 
74
73
  def name=(n)
@@ -177,6 +176,10 @@ module Rglpk
177
176
  Glpk_wrapper.glp_simplex(@lp, parm)
178
177
  end
179
178
 
179
+ def status
180
+ Glpk_wrapper.glp_get_status(@lp)
181
+ end
182
+
180
183
  def mip(options = {})
181
184
  parm = Glpk_wrapper::Glp_iocp.new
182
185
  Glpk_wrapper.glp_init_iocp(parm)
@@ -187,9 +190,9 @@ module Rglpk
187
190
  apply_options_to_parm(options, parm)
188
191
  Glpk_wrapper.glp_intopt(@lp, parm)
189
192
  end
190
-
191
- def status
192
- Glpk_wrapper.glp_get_status(@lp)
193
+
194
+ def mip_status
195
+ Glpk_wrapper.glp_mip_status(@lp)
193
196
  end
194
197
  end
195
198
 
data/rglpk.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rglpk}
8
- s.version = "0.2.3"
8
+ s.version = "0.2.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alex Gutteridge", "William Taysom"]
12
- s.date = %q{2010-11-03}
12
+ s.date = %q{2010-11-04}
13
13
  s.description = %q{Rglpk is a package providing a Ruby wrapper to the [GNU GLPK](http://www.gnu.org/software/glpk/) library. The GLPK (GNU Linear Programming Kit) package is intended for solving large-scale linear programming (LP), mixed integer programming (MIP), and other related problems.
14
14
 
15
15
  Rglpk (pronounced as "wriggle-pick") is currently in alpha status and the API should be considered subject to change. Rglpk uses [Swig](http://www.swig.org/) to initially wrap the C GLPK library (using a Swig wrapper originally developed by Nigel Galloway) and then a pure Ruby library to wrap the Swig code in a more friendly OO-style.
@@ -30,14 +30,18 @@ module TestProblemKind
30
30
  def verify_results(*results)
31
31
  if column_kind == Rglpk::GLP_CV
32
32
  solution_method = :simplex
33
+ status_method = :status
33
34
  value_method = :get_prim
34
35
  else
35
36
  solution_method = :mip
37
+ status_method = :mip_status
36
38
  value_method = :mip_val
37
39
  end
38
40
 
39
41
  @p.send(solution_method, {:presolve => Rglpk::GLP_ON})
40
42
 
43
+ assert_equal Rglpk::GLP_OPT, @p.send(status_method)
44
+
41
45
  @p.cols.each_with_index do |col, index|
42
46
  assert_equal results[index], col.send(value_method)
43
47
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rglpk
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Gutteridge
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-03 00:00:00 +08:00
19
+ date: 2010-11-04 00:00:00 +08:00
20
20
  default_executable:
21
21
  dependencies: []
22
22