rglpk 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +8 -0
- data/VERSION +1 -1
- data/lib/rglpk.rb +7 -4
- data/rglpk.gemspec +2 -2
- data/test/test_problem_kind.rb +4 -0
- metadata +4 -4
data/ChangeLog.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
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
|
192
|
-
Glpk_wrapper.
|
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.
|
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-
|
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.
|
data/test/test_problem_kind.rb
CHANGED
@@ -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:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
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-
|
19
|
+
date: 2010-11-04 00:00:00 +08:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|