Skip to content

Instantly share code, notes, and snippets.

@nelsnelson
Created April 21, 2011 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nelsnelson/933776 to your computer and use it in GitHub Desktop.
Save nelsnelson/933776 to your computer and use it in GitHub Desktop.
JRuby demonstration exhibiting Matrix failure
$ ruby ./matrix_test.rb
Attempting to create a matrix
a = [
[1, 2, 3]
[:a, :b, :c]
["x", "y", "z"]
["#", "%"]
]
Matrix.columns(a)
Matrix[[1, a, x, #], [2, b, y, %], [3, c, z, ]]
$ jruby ./matrix_test.rb
Attempting to create a matrix
a = [
[1, 2, 3]
[:a, :b, :c]
["x", "y", "z"]
["#", "%"]
]
Matrix.columns(a)
ExceptionForMatrix::ErrDimensionMismatch: Matrix dimension mismatch
Raise at /usr/java/jruby/lib/ruby/1.8/e2mmap.rb:167
Raise at /usr/java/jruby/lib/ruby/1.8/e2mmap.rb:87
rows at /usr/java/jruby/lib/ruby/1.8/matrix.rb:139
each at org/jruby/RubyArray.java:1572
rows at /usr/java/jruby/lib/ruby/1.8/matrix.rb:138
columns at /usr/java/jruby/lib/ruby/1.8/matrix.rb:151
(root) at ./matrix_test.rb:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment