[PATCH] Implement monadic operator for Matrix
m = Matrix[[1,2,3], [4,5,6]] + m NoMethodError: undefined method `+@' for Matrix[[1, 2, 3], [4, 5, 6]]:Matrix - m NoMethodError: undefined method `-@' for Matrix[[1, 2, 3], [4, 5, 6]]:Matrix
m = Matrix[[1,2,3], [4,5,6]] + m => Matrix[[1, 2, 3], [4, 5, 6]] - m => Matrix[[-1, -2, -3], [-4, -5, -6]]
I think monadic operator for Matrix is important, when I use operator as block. like that
#3 [ruby-core:63885] Updated by gogotanaka (Kazuki Tanaka) almost 4 years ago
Yukihiro Matsumoto wrote:
unary operator has nothing related to inject though.
It's kind of my mistake, sorry to confuse you.
I think it not seldom happens that we want do this(term monadic). And this is based on custom in math.
Compared with some other numerical analysis software(MATLAB, mathematica, GNU Octave, R, NumPy),
They have term monadic for matrix, vector. (But you can say "this is ruby issue! this is no business of how other softwares are" )