rglpk 0.2.6 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 552dbb84e1fc9a6661666fae09a1b1ae80d226f3
4
+ data.tar.gz: a9eee0901b2ed3e7372f4e6c329beb989bdb3191
5
+ SHA512:
6
+ metadata.gz: 21fd4b04d71e47dd9876465ad9ab0e1535a20850c550972ae4433365e10d5be43aa4bf69a56fc3fdb5e4f764bb2955449026c2ec88f283966cfdc4eaa9ad8482
7
+ data.tar.gz: 5b80ba77d56efc2772e58247a1e02019d12a9afe25aa70960398a572756c6802e46e8d0bd682035c83c0af0aef8db1cc08543f9aaa469284315203fb8a86f3a2
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ cache: bundler
3
+ rvm:
4
+ - 1.9.3
5
+ before_install:
6
+ - sudo apt-get update -qq
7
+ - sudo apt-get install -y libglpk-dev swig
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development do
4
+ gem 'jeweler'
5
+ gem 'minitest'
6
+ gem 'rake'
7
+ end
@@ -0,0 +1,57 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ addressable (2.3.7)
5
+ builder (3.2.2)
6
+ descendants_tracker (0.0.4)
7
+ thread_safe (~> 0.3, >= 0.3.1)
8
+ faraday (0.9.1)
9
+ multipart-post (>= 1.2, < 3)
10
+ git (1.2.9.1)
11
+ github_api (0.12.3)
12
+ addressable (~> 2.3)
13
+ descendants_tracker (~> 0.0.4)
14
+ faraday (~> 0.8, < 0.10)
15
+ hashie (>= 3.3)
16
+ multi_json (>= 1.7.5, < 2.0)
17
+ nokogiri (~> 1.6.3)
18
+ oauth2
19
+ hashie (3.4.1)
20
+ highline (1.6.21)
21
+ jeweler (2.0.1)
22
+ builder
23
+ bundler (>= 1.0)
24
+ git (>= 1.2.5)
25
+ github_api
26
+ highline (>= 1.6.15)
27
+ nokogiri (>= 1.5.10)
28
+ rake
29
+ rdoc
30
+ json (1.8.2)
31
+ jwt (1.3.0)
32
+ mini_portile (0.6.2)
33
+ minitest (5.5.1)
34
+ multi_json (1.11.0)
35
+ multi_xml (0.5.5)
36
+ multipart-post (2.0.0)
37
+ nokogiri (1.6.6.2)
38
+ mini_portile (~> 0.6.0)
39
+ oauth2 (0.9.4)
40
+ faraday (>= 0.8, < 0.10)
41
+ jwt (~> 1.0)
42
+ multi_json (~> 1.3)
43
+ multi_xml (~> 0.5)
44
+ rack (~> 1.2)
45
+ rack (1.6.0)
46
+ rake (10.4.2)
47
+ rdoc (4.2.0)
48
+ json (~> 1.4)
49
+ thread_safe (0.3.5)
50
+
51
+ PLATFORMS
52
+ ruby
53
+
54
+ DEPENDENCIES
55
+ jeweler
56
+ minitest
57
+ rake
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/wtaysom/rglpk.svg)](https://travis-ci.org/wtaysom/rglpk)
2
+
1
3
  # Introduction
2
4
 
3
5
  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.
@@ -16,6 +18,7 @@ A working GLPK library installation is required. Currently, Rglpk is tested wit
16
18
  > make
17
19
  > make check
18
20
  > make install
21
+ > ldconfig # creates the necessary links and cache to the most recent shared libraries
19
22
 
20
23
  Rglpk is only available as a gem:
21
24
 
data/Rakefile CHANGED
@@ -68,4 +68,6 @@ CLOBBER.include('ext/glpk_wrapper.c', 'rglpk.gemspec')
68
68
  desc "Run Test::Unit tests."
69
69
  task :test => :build_extension do
70
70
  system("ruby test/test_all.rb")
71
- end
71
+ end
72
+
73
+ task :default => [:test]
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.6
1
+ 0.4.0
@@ -101,8 +101,11 @@ module Rglpk
101
101
  def add_rows(n)
102
102
  Glpk_wrapper.glp_add_rows(@lp, n)
103
103
  s = @rows.size
104
- n.times{|i| @rows.send(:push, Row.new(self, s + i + 1))}
105
- @rows
104
+ n.times.map do |i|
105
+ new_row = Row.new(self, s + i + 1)
106
+ @rows.send(:push, new_row)
107
+ new_row
108
+ end
106
109
  end
107
110
 
108
111
  def add_col
@@ -115,8 +118,11 @@ module Rglpk
115
118
  def add_cols(n)
116
119
  Glpk_wrapper.glp_add_cols(@lp, n)
117
120
  s = @cols.size
118
- n.times{|i| @cols.send(:push, Column.new(self, s + i + 1))}
119
- @cols
121
+ n.times.map do |i|
122
+ new_col = Column.new(self, s + i + 1)
123
+ @cols.send(:push, new_col)
124
+ new_col
125
+ end
120
126
  end
121
127
 
122
128
  def del_rows(a)
Binary file
@@ -1,6 +1,6 @@
1
1
  here = File.expand_path(File.dirname(__FILE__))
2
2
 
3
- require 'test/unit'
3
+ require 'minitest/autorun'
4
4
  $LOAD_PATH << './ext'
5
5
  require here+'/../lib/rglpk'
6
6
 
@@ -51,4 +51,4 @@ module Examples
51
51
  p.simplex
52
52
  p
53
53
  end
54
- end
54
+ end
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('helper', File.dirname(__FILE__))
2
2
 
3
- class TestRglpk < Test::Unit::TestCase
3
+ class TestRglpk < Minitest::Test
4
4
 
5
5
  def test_create
6
6
  assert_instance_of Rglpk::Problem, Rglpk::Problem.new
@@ -24,7 +24,7 @@ class TestRglpk < Test::Unit::TestCase
24
24
  assert_equal Rglpk::GLP_MIN, p.obj.dir
25
25
  p.obj.dir = Rglpk::GLP_MAX
26
26
  assert_equal Rglpk::GLP_MAX, p.obj.dir
27
- assert_raise(ArgumentError){p.obj.dir = 3}
27
+ assert_raises(ArgumentError){p.obj.dir = 3}
28
28
  end
29
29
 
30
30
  def test_add_row
@@ -107,7 +107,7 @@ class TestRglpk < Test::Unit::TestCase
107
107
  def test_set_row
108
108
  p = Rglpk::Problem.new
109
109
  p.add_rows(2)
110
- assert_raise(RuntimeError){p.rows[1].set([1, 2])}
110
+ assert_raises(RuntimeError){p.rows[1].set([1, 2])}
111
111
  p.add_cols(2)
112
112
  p.rows[1].set([1, 2])
113
113
  assert_equal [1, 2], p.rows[1].get
@@ -116,7 +116,7 @@ class TestRglpk < Test::Unit::TestCase
116
116
  def test_set_col
117
117
  p = Rglpk::Problem.new
118
118
  p.add_cols(2)
119
- assert_raise(RuntimeError){p.cols[1].set([1, 2])}
119
+ assert_raises(RuntimeError){p.cols[1].set([1, 2])}
120
120
  p.add_rows(2)
121
121
  p.cols[1].set([1, 2])
122
122
  assert_equal [1, 2], p.cols[1].get
@@ -211,4 +211,4 @@ class TestRglpk < Test::Unit::TestCase
211
211
  def test_derived
212
212
  D.new.add_rows(10)
213
213
  end
214
- end
214
+ end
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('helper', File.dirname(__FILE__))
2
2
 
3
- class TestBriefExample < Test::Unit::TestCase
3
+ class TestBriefExample < Minitest::Test
4
4
  include Examples
5
5
 
6
6
  def test_brief_example
@@ -22,4 +22,4 @@ class TestBriefExample < Test::Unit::TestCase
22
22
  p.write_lp("test.lp")
23
23
  assert File.exists?("test.lp")
24
24
  end
25
- end
25
+ end
@@ -1,6 +1,6 @@
1
1
  require File.expand_path('helper', File.dirname(__FILE__))
2
2
 
3
- class TestMemoryLeaks < Test::Unit::TestCase
3
+ class TestMemoryLeaks < Minitest::Test
4
4
  include Examples
5
5
 
6
6
  def test_memory_prof
@@ -27,4 +27,4 @@ class TestMemoryLeaks < Test::Unit::TestCase
27
27
  ensure
28
28
  @change_to_real_memory_in_kb__prev = r
29
29
  end
30
- end
30
+ end
@@ -48,7 +48,7 @@ module TestProblemKind
48
48
  end
49
49
  end
50
50
 
51
- class BinaryVariables < Test::Unit::TestCase
51
+ class BinaryVariables < Minitest::Test
52
52
  include TestProblemKind
53
53
 
54
54
  def column_kind
@@ -60,7 +60,7 @@ class BinaryVariables < Test::Unit::TestCase
60
60
  end
61
61
  end
62
62
 
63
- class IntegerVariables < Test::Unit::TestCase
63
+ class IntegerVariables < Minitest::Test
64
64
  include TestProblemKind
65
65
 
66
66
  def column_kind
@@ -72,7 +72,7 @@ class IntegerVariables < Test::Unit::TestCase
72
72
  end
73
73
  end
74
74
 
75
- class ContinuousVariables < Test::Unit::TestCase
75
+ class ContinuousVariables < Minitest::Test
76
76
  include TestProblemKind
77
77
 
78
78
  def column_kind
@@ -82,4 +82,4 @@ class ContinuousVariables < Test::Unit::TestCase
82
82
  def test_results
83
83
  verify_results(2.5, 1.5, 3.5)
84
84
  end
85
- end
85
+ end
metadata CHANGED
@@ -1,39 +1,78 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rglpk
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.2.6
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.0
6
5
  platform: ruby
7
- authors:
6
+ authors:
8
7
  - Alex Gutteridge
9
8
  - William Taysom
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
-
14
- date: 2012-01-03 00:00:00 +08:00
15
- default_executable:
16
- dependencies: []
17
-
12
+ date: 2015-05-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: jeweler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: minitest
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
18
56
  description: |-
57
+ # Introduction
58
+
19
59
  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.
20
-
60
+
21
61
  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.
22
-
23
- See [github](http://github.com/wtaysom/rglpk) for installation instructions. All bug reports, feature requests and patches are welcome. Enjoy!
24
- email:
62
+ email:
25
63
  - alexg@kuicr.kyoto-u.ac.jp
26
64
  - wtaysom@gmail.com
27
65
  executables: []
28
-
29
- extensions:
66
+ extensions:
30
67
  - ext/extconf.rb
31
- - ext/extconf.rb
32
- extra_rdoc_files:
68
+ extra_rdoc_files:
33
69
  - ChangeLog.md
34
70
  - README.md
35
- files:
71
+ files:
72
+ - ".travis.yml"
36
73
  - ChangeLog.md
74
+ - Gemfile
75
+ - Gemfile.lock
37
76
  - License.txt
38
77
  - README.md
39
78
  - Rakefile
@@ -51,36 +90,29 @@ files:
51
90
  - test/test_brief_example.rb
52
91
  - test/test_memory_leaks.rb
53
92
  - test/test_problem_kind.rb
54
- has_rdoc: true
55
93
  homepage: http://rglpk.rubyforge.org/
56
94
  licenses: []
57
-
95
+ metadata: {}
58
96
  post_install_message:
59
- rdoc_options:
60
- - --exclude
61
- - .
62
- require_paths:
97
+ rdoc_options:
98
+ - "--exclude"
99
+ - "."
100
+ require_paths:
63
101
  - lib
64
- - ext
65
- - ext
66
- required_ruby_version: !ruby/object:Gem::Requirement
67
- none: false
68
- requirements:
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
69
104
  - - ">="
70
- - !ruby/object:Gem::Version
71
- version: "0"
72
- required_rubygems_version: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
75
109
  - - ">="
76
- - !ruby/object:Gem::Version
77
- version: "0"
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
78
112
  requirements: []
79
-
80
113
  rubyforge_project: rglpk
81
- rubygems_version: 1.6.2
114
+ rubygems_version: 2.4.6
82
115
  signing_key:
83
- specification_version: 3
84
- summary: 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.
116
+ specification_version: 4
117
+ summary: "# Introduction"
85
118
  test_files: []
86
-