replace raise method from e2mmap on Scalar class

This commit is contained in:
Hiroshi SHIBATA 2019-11-29 16:50:54 +09:00 коммит произвёл SHIBATA Hiroshi
Родитель 9b950310be
Коммит 5044260dcd
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -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