diff --git a/lib/matrix.rb b/lib/matrix.rb index 76bec92..ee5a716 100644 --- a/lib/matrix.rb +++ b/lib/matrix.rb @@ -86,6 +86,7 @@ end # * #inverse # * #inv # * #** +# * #+@ # # Matrix functions: # * #determinant @@ -1040,6 +1041,10 @@ class Matrix end end + def +@ + self + end + #-- # MATRIX FUNCTIONS -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- #++ diff --git a/test/matrix/test_matrix.rb b/test/matrix/test_matrix.rb index 7c466e6..13ffbb8 100644 --- a/test/matrix/test_matrix.rb +++ b/test/matrix/test_matrix.rb @@ -57,6 +57,10 @@ class TestMatrix < Test::Unit::TestCase assert_equal @m1.hash, @m3.hash end + def test_uplus + assert_equal(@m1, +@m1) + end + def test_rank [ [[0]],