diff options
author | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-11-03 13:41:57 +0000 |
---|---|---|
committer | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-11-03 13:41:57 +0000 |
commit | edaf0477a5b58460dab76a30288578f42b5db3c8 (patch) | |
tree | c1a7b1b35533029b472c1db81609c34b596cba42 | |
parent | 7ef9fbb35fe2bc6efebefaa3bf656133efd4a939 (diff) |
* matrix.rb (Matrix#column_vectors, Matrix#row_vectors): ditto bug.
this bug report and fix by [email protected].
* forwardable.rb: change raise to Kernel::raise
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/forwardable.rb | 4 | ||||
-rw-r--r-- | lib/matrix.rb | 8 |
3 files changed, 12 insertions, 6 deletions
@@ -1,3 +1,9 @@ +Sat Nov 3 22:28:51 2001 Keiju Ishitsuka <[email protected]> + * matrix.rb (Matrix#column_vectors, Matrix#row_vectors): ditto bug. + this bug report and fix by [email protected]. + + * forwardable.rb: change raise to Kernel::raise + Thu Nov 1 14:08:42 2001 Yukihiro Matsumoto <[email protected]> * bignum.c (rb_big_aref): idx may be a Bignum. diff --git a/lib/forwardable.rb b/lib/forwardable.rb index 7f57f77f53..b845f76ec4 100644 --- a/lib/forwardable.rb +++ b/lib/forwardable.rb @@ -51,7 +51,7 @@ module Forwardable #{accessor}.__send__(:#{method}, *args, &block) rescue Exception [email protected]_if{|s| /^\\(__FORWARDABLE__\\):/ =~ s} unless Forwardable::debug - raise + Kernel::raise end end EOS @@ -79,7 +79,7 @@ module SingleForwardable #{accessor}.__send__(:#{method}, *args,&block) rescue Exception [email protected]_if{|s| /^\\(__FORWARDABLE__\\):/ =~ s} unless Forwardable::debug - raise + Kernel::raise end end EOS diff --git a/lib/matrix.rb b/lib/matrix.rb index cf2f63765a..fa454e338e 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -394,7 +394,7 @@ class Matrix # ARITHMETIC - def *(m) #is matrix or vector or number" + def *(m) # m is matrix or vector or number case(m) when Numeric rows = @rows.collect { @@ -693,7 +693,7 @@ class Matrix end def row_vectors - rows = (0 .. column_size - 1).collect { + rows = (0 .. row_size - 1).collect { |i| row(i) } @@ -701,7 +701,7 @@ class Matrix end def column_vectors - columns = (0 .. row_size - 1).collect { + columns = (0 .. column_size - 1).collect { |i| column(i) } @@ -896,7 +896,7 @@ class Vector # ARITHMETIC - def *(x) + def *(x) #x is matrix or number case x when Numeric els = @elements.collect{|e| e * x} |