summaryrefslogtreecommitdiff
path: root/test/matrix
diff options
context:
space:
mode:
authorFernando Wolf Bona <bonafernando@gmail.com>2019-08-21 17:36:39 -0300
committerMarc-André Lafortune <github@marc-andre.ca>2019-08-21 16:36:39 -0400
commit8d804e41a013ab1967a703a0ce388b579f735ac8 (patch)
tree79e7f24dd430bef8349da25ef0e7dc51c9ce65be /test/matrix
parent48fdc37ad52d9a59763da4c1c22683713b7ddea8 (diff)
Add abs to Matrix (#2199)
Diffstat (limited to 'test/matrix')
-rw-r--r--test/matrix/test_matrix.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/matrix/test_matrix.rb b/test/matrix/test_matrix.rb
index 3ecb9d2f8b..7dbb1000d9 100644
--- a/test/matrix/test_matrix.rb
+++ b/test/matrix/test_matrix.rb
@@ -583,6 +583,11 @@ class TestMatrix < Test::Unit::TestCase
assert_equal(1, s1 ** o)
end
+ def test_abs
+ s1 = @a3.abs
+ assert_equal(s1, Matrix[[4, 1, 3], [0, 3, 7], [11, 4, 2]])
+ end
+
def test_hstack
assert_equal Matrix[[1,2,3,2,3,4,1,2,3], [4,5,6,5,6,7,4,5,6]],
@m1.hstack(@n1, @m1)