1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* matrix.rb (Matrix#column_vectors, Matrix#row_vectors): ditto bug.

this bug report and fix by tsutomu@nucba.ac.jp.

* forwardable.rb: change raise to Kernel::raise


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
keiju 2001-11-03 13:41:57 +00:00
parent 7ef9fbb35f
commit edaf0477a5
3 changed files with 12 additions and 6 deletions

View file

@ -1,3 +1,9 @@
Sat Nov 3 22:28:51 2001 Keiju Ishitsuka <keiju@ishitsuka.com>
* matrix.rb (Matrix#column_vectors, Matrix#row_vectors): ditto bug.
this bug report and fix by tsutomu@nucba.ac.jp.
* forwardable.rb: change raise to Kernel::raise
Thu Nov 1 14:08:42 2001 Yukihiro Matsumoto <matz@ruby-lang.org> Thu Nov 1 14:08:42 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* bignum.c (rb_big_aref): idx may be a Bignum. * bignum.c (rb_big_aref): idx may be a Bignum.

View file

@ -51,7 +51,7 @@ module Forwardable
#{accessor}.__send__(:#{method}, *args, &block) #{accessor}.__send__(:#{method}, *args, &block)
rescue Exception rescue Exception
$@.delete_if{|s| /^\\(__FORWARDABLE__\\):/ =~ s} unless Forwardable::debug $@.delete_if{|s| /^\\(__FORWARDABLE__\\):/ =~ s} unless Forwardable::debug
raise Kernel::raise
end end
end end
EOS EOS
@ -79,7 +79,7 @@ module SingleForwardable
#{accessor}.__send__(:#{method}, *args,&block) #{accessor}.__send__(:#{method}, *args,&block)
rescue Exception rescue Exception
$@.delete_if{|s| /^\\(__FORWARDABLE__\\):/ =~ s} unless Forwardable::debug $@.delete_if{|s| /^\\(__FORWARDABLE__\\):/ =~ s} unless Forwardable::debug
raise Kernel::raise
end end
end end
EOS EOS

View file

@ -394,7 +394,7 @@ class Matrix
# ARITHMETIC # ARITHMETIC
def *(m) #is matrix or vector or number" def *(m) # m is matrix or vector or number
case(m) case(m)
when Numeric when Numeric
rows = @rows.collect { rows = @rows.collect {
@ -693,7 +693,7 @@ class Matrix
end end
def row_vectors def row_vectors
rows = (0 .. column_size - 1).collect { rows = (0 .. row_size - 1).collect {
|i| |i|
row(i) row(i)
} }
@ -701,7 +701,7 @@ class Matrix
end end
def column_vectors def column_vectors
columns = (0 .. row_size - 1).collect { columns = (0 .. column_size - 1).collect {
|i| |i|
column(i) column(i)
} }
@ -896,7 +896,7 @@ class Vector
# ARITHMETIC # ARITHMETIC
def *(x) def *(x) #x is matrix or number
case x case x
when Numeric when Numeric
els = @elements.collect{|e| e * x} els = @elements.collect{|e| e * x}