aboutsummaryrefslogtreecommitdiffstats
path: root/test/matrix/test_matrix.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/matrix/test_matrix.rb')
-rw-r--r--test/matrix/test_matrix.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/matrix/test_matrix.rb b/test/matrix/test_matrix.rb
index 8e0848de01..6b9b587c6d 100644
--- a/test/matrix/test_matrix.rb
+++ b/test/matrix/test_matrix.rb
@@ -144,4 +144,13 @@ class TestMatrix < Test::Unit::TestCase
assert_equal 3, m.transpose.rank
end
end
+
+ def test_inverse
+ assert_equal(Matrix[[-1, 1], [0, -1]], Matrix[[-1, -1], [0, -1]].inverse)
+ end
+
+ def test_determinant
+ assert_equal(45, Matrix[[7,6], [3,9]].determinant)
+ assert_equal(-18, Matrix[[2,0,1],[0,-2,2],[1,2,3]].determinant)
+ end
end