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

replace raise method from e2mmap on Scalar class

This commit is contained in:
Hiroshi SHIBATA 2019-11-29 16:50:54 +09:00 committed by SHIBATA Hiroshi
parent 9b950310be
commit 5044260dcd
Notes: git 2019-11-30 08:01:07 +09:00

View file

@ -1749,7 +1749,7 @@ class Matrix
when Numeric
Scalar.new(@value + other)
when Vector, Matrix
Scalar.Raise ErrOperationNotDefined, "+", @value.class, other.class
raise ErrOperationNotDefined, ["+", @value.class, other.class]
else
apply_through_coercion(other, __method__)
end
@ -1760,7 +1760,7 @@ class Matrix
when Numeric
Scalar.new(@value - other)
when Vector, Matrix
Scalar.Raise ErrOperationNotDefined, "-", @value.class, other.class
raise ErrOperationNotDefined, ["-", @value.class, other.class]
else
apply_through_coercion(other, __method__)
end
@ -1782,7 +1782,7 @@ class Matrix
when Numeric
Scalar.new(@value / other)
when Vector
Scalar.Raise ErrOperationNotDefined, "/", @value.class, other.class
raise ErrOperationNotDefined, ["/", @value.class, other.class]
when Matrix
self * other.inverse
else
@ -1795,10 +1795,10 @@ class Matrix
when Numeric
Scalar.new(@value ** other)
when Vector
Scalar.Raise ErrOperationNotDefined, "**", @value.class, other.class
raise ErrOperationNotDefined, ["**", @value.class, other.class]
when Matrix
#other.powered_by(self)
Scalar.Raise ErrOperationNotImplemented, "**", @value.class, other.class
raise ErrOperationNotImplemented, ["**", @value.class, other.class]
else
apply_through_coercion(other, __method__)
end