[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:01940] Re: Matrix inconsistent ERR

From: matz@... (Yukihiro Matsumoto)
Date: 2000-03-17 01:58:25 UTC
List: ruby-talk #1940
Hi,

In message "[ruby-talk:01920] Matrix inconsistent ERR"
    on 00/03/16, "Dat Nguyen" <thucdat@hotmail.com> writes:
|
|ruby> require 'matrix'
|ruby> m1 = Matrix[[1,2,3],[4,5]]
|Matrix[[1,2,3],[4,5]]
|ruby> m2 = Matrix[[2,1],[6,8]]
|Matrix[[2,1],[6,8]]
|m3 = m1 * m2
|#{self.name} dimension mismatch"
|ERR: /Program/Ruby/matrix.rb:415:in `*': Matrix dimension mismatch
|ruby> m3 = m2 * m1
|ERR: /Program/Ruby/matrix.rb:424:in `*': nil can't be coerced into Fixnum
|
|Question: Why the error messages are different?

Because Matrix[[1,2,3],[4,5]] i.e.

   |1 2 3|
   |4 5  |

is not a matrix.  But I think inconsistent error message is not
intended.  I ask for the author of matrix.rb to change this.

							matz.

In This Thread

Prev Next