octave-ruby 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ == 1.0.9 / 2008-12-30
2
+
3
+ * 1 major bug fix
4
+ * 1xn matrices are converted to Octave::*Matrix instead of Ruby arrays
5
+
1
6
  == 1.0.8 / 2008-11-26
2
7
 
3
8
  * 1 major bug fix
@@ -32,6 +32,7 @@ lib/octave/driver/native/driver.rb
32
32
  lib/octave/engine.rb
33
33
  lib/octave/matrix.rb
34
34
  lib/octave/version.rb
35
+ octave-ruby.gemspec
35
36
  setup.rb
36
37
  test/driver/native/test_conversions.rb
37
38
  test/driver/native/test_driver.rb
data/README.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  octave-ruby
2
2
  http://octave-ruby.rubyforge.org/
3
- jonathan.younger@lipomics.com
3
+ jonathan@daikini.com
4
4
  A big thank you to Lipomics Technologies, Inc. http://www.lipomics.com for sponsoring this project.
5
5
 
6
6
  == DESCRIPTION:
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ require './lib/octave/version.rb'
7
7
  Hoe.new('octave-ruby', Octave::Version::STRING) do |p|
8
8
  p.rubyforge_name = 'octave-ruby'
9
9
  p.author = ["Jonathan Younger"]
10
- p.email = ["jonathan.younger@lipomics.com"]
10
+ p.email = ["jonathan@daikini.com"]
11
11
  p.summary = "A Ruby interface to the Octave interpreted language."
12
12
  p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
13
13
  p.url = "http://octave-ruby.rubyforge.org/"
@@ -12,8 +12,6 @@ VALUE OR_CellMatrix::to_ruby()
12
12
 
13
13
  if (number_of_rows == 1 && number_of_columns == 1) {
14
14
  return OR_Variable(cell(0)).to_ruby();
15
- } else if (number_of_rows == 1) {
16
- number_of_values = number_of_columns;
17
15
  } else if (number_of_columns == 1) {
18
16
  number_of_values = number_of_rows;
19
17
  } else {
@@ -16,8 +16,6 @@ VALUE OR_Matrix::to_ruby()
16
16
 
17
17
  if ((number_of_rows == 0) && (number_of_columns == 0)) {
18
18
  return rb_ary_new2(0);
19
- } else if (number_of_rows == 1) {
20
- values = matrix.row(0);
21
19
  } else if (number_of_columns == 1) {
22
20
  values = matrix.column(0);
23
21
  } else {
@@ -4,7 +4,7 @@ module Octave
4
4
 
5
5
  MAJOR = 1
6
6
  MINOR = 0
7
- TINY = 8
7
+ TINY = 9
8
8
 
9
9
  STRING = [ MAJOR, MINOR, TINY ].join( "." )
10
10
  #:beta-tag:
@@ -0,0 +1,21 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{octave-ruby}
3
+ s.version = "1.0.9"
4
+
5
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
+ s.authors = ["Jonathan Younger"]
7
+ s.date = %q{2008-12-30}
8
+ s.description = %q{== USAGE: require 'octave' engine = Octave::Engine.new engine.eval "123.456 * 789.101112" engine.rand(10) matrix = Octave::Matrix.new(20, 400) 20.times { |m| 400.times { |n| matrix[m, n] = rand } } engine.put_variable("m", matrix) engine.save "/tmp/20_x_400_matrix" == REQUIREMENTS: * Octave * GCC or some other compiler to build the included extension * Mocha (For testing only)}
9
+ s.email = ["jonathan@daikini.com"]
10
+ s.extensions = ["ext/octave_api/extconf.rb"]
11
+ s.extra_rdoc_files = ["History.txt", "LICENSE.txt", "Manifest.txt", "README.txt"]
12
+ s.files = ["History.txt", "LICENSE.txt", "Manifest.txt", "README.txt", "Rakefile", "ext/octave_api/MANIFEST", "ext/octave_api/Makefile", "ext/octave_api/extconf.rb", "ext/octave_api/octave-includes.h", "ext/octave_api/octave-ruby.cpp", "ext/octave_api/octave-ruby.h", "ext/octave_api/octave_api.c", "ext/octave_api/octave_api.h", "ext/octave_api/or-array.cpp", "ext/octave_api/or-array.h", "ext/octave_api/or-boolean_matrix.cpp", "ext/octave_api/or-boolean_matrix.h", "ext/octave_api/or-cell_matrix.cpp", "ext/octave_api/or-cell_matrix.h", "ext/octave_api/or-hash.cpp", "ext/octave_api/or-hash.h", "ext/octave_api/or-matrix.cpp", "ext/octave_api/or-matrix.h", "ext/octave_api/or-string.cpp", "ext/octave_api/or-string.h", "ext/octave_api/or-struct_matrix.cpp", "ext/octave_api/or-struct_matrix.h", "ext/octave_api/or-variable.cpp", "ext/octave_api/or-variable.h", "lib/octave.rb", "lib/octave/driver/native/driver.rb", "lib/octave/engine.rb", "lib/octave/matrix.rb", "lib/octave/version.rb", "octave-ruby.gemspec", "setup.rb", "test/driver/native/test_conversions.rb", "test/driver/native/test_driver.rb", "test/test_engine.rb"]
13
+ s.has_rdoc = true
14
+ s.homepage = %q{http://octave-ruby.rubyforge.org/}
15
+ s.rdoc_options = ["--main", "README.txt"]
16
+ s.require_paths = ["lib", "ext"]
17
+ s.rubyforge_project = %q{octave-ruby}
18
+ s.rubygems_version = %q{1.3.1}
19
+ s.summary = %q{A Ruby interface to the Octave interpreted language.}
20
+ s.test_files = ["test/driver/native/test_conversions.rb", "test/driver/native/test_driver.rb", "test/test_engine.rb"]
21
+ end
@@ -101,17 +101,18 @@ class ConversionsTest < Test::Unit::TestCase
101
101
  assert_octave_and_ruby_equal []
102
102
  end
103
103
 
104
- def test_should_convert_a_1xn_octave_matrix_to_an_array
104
+ def test_should_convert_a_1xn_octave_matrix_to_an_octave_matrix
105
105
  matrix = Octave::Matrix.new(1, 3)
106
106
  matrix[0, 0] = 1
107
107
  matrix[0, 1] = 2
108
108
  matrix[0, 2] = 3
109
109
 
110
- expected_array = [1,2,3]
111
- result = to_octave_to_ruby(matrix)
112
-
113
- assert_equal expected_array, result
114
- assert_instance_of Array, result
110
+ result = @driver.put_variable "octave_matrix", matrix
111
+
112
+ assert_instance_of Octave::Matrix, result
113
+ assert_equal matrix, result
114
+ assert_equal 1, @driver.feval("rows", result)
115
+ assert_equal 3, @driver.feval("columns", result)
115
116
  end
116
117
 
117
118
  def test_should_convert_an_nx1_octave_matrix_to_an_array
@@ -125,6 +126,8 @@ class ConversionsTest < Test::Unit::TestCase
125
126
 
126
127
  assert_equal expected_array, result
127
128
  assert_instance_of Array, result
129
+ assert_equal 3, @driver.feval("rows", result)
130
+ assert_equal 1, @driver.feval("columns", result)
128
131
  end
129
132
 
130
133
  def test_should_convert_octave_struct_matrix
@@ -169,13 +172,18 @@ class ConversionsTest < Test::Unit::TestCase
169
172
  assert_equal [1, 2, 3], to_octave_to_ruby(cell_matrix)
170
173
  end
171
174
 
172
- def test_should_convert_a_1xn_cell_matrix_to_an_array
175
+ def test_should_convert_a_1xn_cell_matrix_to_an_octave_cell_matrix
173
176
  cell_matrix = Octave::CellMatrix.new(1, 3)
174
177
  cell_matrix[0,0] = "foo"
175
178
  cell_matrix[0,1] = "bar"
176
179
  cell_matrix[0,2] = "baz"
177
180
 
178
- assert_equal %w(foo bar baz), to_octave_to_ruby(cell_matrix)
181
+ result = @driver.put_variable "octave_cell_matrix", cell_matrix
182
+
183
+ assert_instance_of Octave::CellMatrix, result
184
+ assert_equal cell_matrix, result
185
+ assert_equal 1, @driver.feval("rows", result)
186
+ assert_equal 3, @driver.feval("columns", result)
179
187
  end
180
188
 
181
189
  def test_should_convert_a_nx1_cell_matrix_to_an_array
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octave-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Younger
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-11-26 00:00:00 -07:00
12
+ date: 2008-12-30 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -24,7 +24,7 @@ dependencies:
24
24
  version:
25
25
  description: "== USAGE: require 'octave' engine = Octave::Engine.new engine.eval \"123.456 * 789.101112\" engine.rand(10) matrix = Octave::Matrix.new(20, 400) 20.times { |m| 400.times { |n| matrix[m, n] = rand } } engine.put_variable(\"m\", matrix) engine.save \"/tmp/20_x_400_matrix\" == REQUIREMENTS: * Octave * GCC or some other compiler to build the included extension * Mocha (For testing only)"
26
26
  email:
27
- - jonathan.younger@lipomics.com
27
+ - jonathan@daikini.com
28
28
  executables: []
29
29
 
30
30
  extensions:
@@ -69,6 +69,7 @@ files:
69
69
  - lib/octave/engine.rb
70
70
  - lib/octave/matrix.rb
71
71
  - lib/octave/version.rb
72
+ - octave-ruby.gemspec
72
73
  - setup.rb
73
74
  - test/driver/native/test_conversions.rb
74
75
  - test/driver/native/test_driver.rb