Bug #2649 closed
Vector can't be coerced into Vector
Added by mame (Yusuke Endoh) over 15 years ago.
Updated over 14 years ago.
Description
=begin
遠藤です。
Vector に Vector をかけると Vector can't be coerced into Vector という
例外が出ます。
$ ./ruby -rmatrix -e 'Vector[1, 2, 3] * Vector[4, 5, 6]'
/home/mame/work/ruby/lib/ruby/1.9.1/matrix.rb:1344:in coerce': Vector can't be coerced into Vector (TypeError) from /home/mame/work/ruby/lib/ruby/1.9.1/matrix.rb:1218:in
*'
from -e:1:in `'
Vector に Vector はかけられないので例外になるのは当然ですが、メッセージが
わかりにくいと思います。
--- a/lib/matrix.rb
+++ b/lib/matrix.rb
@@ -1214,6 +1209,8 @@ class Vector
Vector.elements(els, false)
when Matrix
Matrix.column_vector(self) * x
--
Yusuke ENDOH mame@tsg.ne.jp
=end
=begin
けいじゅ@いしつかです.
In [ruby-dev:40150] the message: "[ruby-dev:40150] [Bug:trunk] Vector can't be coerced into Vector", on Jan/26 00:22(JST)
Yusuke ENDOH writes:
遠藤です。
Vector に Vector をかけると Vector can't be coerced into Vector という
例外が出ます。
$ ./ruby -rmatrix -e 'Vector[1, 2, 3] * Vector[4, 5, 6]'
/home/mame/work/ruby/lib/ruby/1.9.1/matrix.rb:1344:in coerce': Vector can't be coerced into Vector (TypeError) from /home/mame/work/ruby/lib/ruby/1.9.1/matrix.rb:1218:in
*'
from -e:1:in `'
Vector に Vector はかけられないので例外になるのは当然ですが、メッセージが
わかりにくいと思います。
おっしゃる通りです.
__
---------------------------------------------------->> 石塚 圭樹 <<---
---------------------------------->> e-mail: keiju@ishitsuka.com <<---
=end
Status changed from Open to Closed
% Done changed from 0 to 100
=begin
This issue was solved with changeset r26448.
Yusuke, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
=end
Also available in: Atom
PDF
Like 0
Like 0 Like 0