Actions
Feature #10069
closed[PATCH] Implement monadic operator for Matrix
Description
Before
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
After
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
matrix_ary.inject(:+)
Files
Actions
Like0
Like0Like0Like0Like0Like0