mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add templated subVector<Vertical/Horizonal>(Index) aliases to col/row(Index) methods (plus subVectors<>() to retrieve the number of rows/columns)
This commit is contained in:
@@ -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() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user