Created
April 21, 2011 05:34
-
-
Save nelsnelson/933776 to your computer and use it in GitHub Desktop.
JRuby demonstration exhibiting Matrix failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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