diff options
author | Gael Guennebaud <g.gael@free.fr> | 2018-10-02 14:02:34 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2018-10-02 14:02:34 +0200 |
commit | 12487531ce45b61f6d764d7b0fea33815bd763da (patch) | |
tree | b71e776dd15febb57fcdf86d4dad81d2dc452fbe /test/block.cpp | |
parent | 37e29fc89389ff1514315b1cf96a8253e0b5c69d (diff) |
Add templated subVector<Vertical/Horizonal>(Index) aliases to col/row(Index) methods (plus subVectors<>() to retrieve the number of rows/columns)
Diffstat (limited to 'test/block.cpp')
-rw-r--r-- | test/block.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/block.cpp b/test/block.cpp index ca13539a9..27b60d778 100644 --- a/test/block.cpp +++ b/test/block.cpp @@ -220,6 +220,13 @@ template<typename MatrixType> void block(const MatrixType& m) VERIFY_RAISES_ASSERT( m1.array() *= m1.col(0).array() ); VERIFY_RAISES_ASSERT( m1.array() /= m1.col(0).array() ); } + + VERIFY_IS_EQUAL( m1.template subVector<Horizontal>(r1), m1.row(r1) ); + VERIFY_IS_APPROX( (m1+m1).template subVector<Horizontal>(r1), (m1+m1).row(r1) ); + VERIFY_IS_EQUAL( m1.template subVector<Vertical>(c1), m1.col(c1) ); + VERIFY_IS_APPROX( (m1+m1).template subVector<Vertical>(c1), (m1+m1).col(c1) ); + VERIFY_IS_EQUAL( m1.template subVectors<Horizontal>(), m1.rows() ); + VERIFY_IS_EQUAL( m1.template subVectors<Vertical>(), m1.cols() ); } |