diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-20 02:18:23 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-20 02:18:23 +0000 |
commit | 62646c8d673b6dd67dba008afdcb5ff1c2eb3614 (patch) | |
tree | 8fae13baf503268a82eef2e1b3d8df20f8f64377 /test/matrix | |
parent | aa95a42190fbe9f9990a60d722366a5e4d89920b (diff) | |
download | ruby-62646c8d673b6dd67dba008afdcb5ff1c2eb3614.tar.gz |
lib/matrix: accept vectors in {h|v}stack
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/matrix')
-rw-r--r-- | test/matrix/test_matrix.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/matrix/test_matrix.rb b/test/matrix/test_matrix.rb index 0831ac6362..5b0bc968f7 100644 --- a/test/matrix/test_matrix.rb +++ b/test/matrix/test_matrix.rb @@ -571,6 +571,8 @@ class TestMatrix < Test::Unit::TestCase assert_equal @e1, @e1.hstack(@e1) assert_equal Matrix.empty(0,6), @e2.hstack(@e2) assert_equal SubMatrix, SubMatrix.hstack(@e1).class + # From Vectors: + assert_equal Matrix[[1, 3],[2, 4]], Matrix.hstack(Vector[1,2], Vector[3, 4]) end def test_vstack @@ -586,6 +588,8 @@ class TestMatrix < Test::Unit::TestCase assert_equal Matrix.empty(4,0), @e1.vstack(@e1) assert_equal @e2, @e2.vstack(@e2) assert_equal SubMatrix, SubMatrix.vstack(@e1).class + # From Vectors: + assert_equal Matrix[[1],[2],[3]], Matrix.vstack(Vector[1,2], Vector[3]) end def test_eigenvalues_and_eigenvectors_symmetric |