diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-05-10 16:24:39 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2009-05-10 16:24:39 +0000 |
commit | 9afd1324fd809631cd0762908629c30d72e61b40 (patch) | |
tree | 3d115110b75b04287c4f869ba757c2da7d5d87e3 /test | |
parent | eac79b6d2e0a4feeccf7e5936cd972fdc4a74ac7 (diff) |
constant Diagonal ---> DiagonalBits
introduce ei_is_diagonal to check for it
DiagonalCoeffs ---> Diagonal and allow Index to by Dynamic
-> add MatrixBase::diagonal(int) with unittest and doc
Diffstat (limited to 'test')
-rw-r--r-- | test/submatrices.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/submatrices.cpp b/test/submatrices.cpp index e34650842..596a8a20e 100644 --- a/test/submatrices.cpp +++ b/test/submatrices.cpp @@ -109,7 +109,6 @@ template<typename MatrixType> void submatrices(const MatrixType& m) VERIFY_IS_APPROX(m1.diagonal(), m1.transpose().diagonal()); m2.diagonal() = 2 * m1.diagonal(); m2.diagonal()[0] *= 3; - VERIFY_IS_APPROX(m2.diagonal()[0], static_cast<Scalar>(6) * m1.diagonal()[0]); const int BlockRows = EIGEN_ENUM_MIN(MatrixType::RowsAtCompileTime,2); const int BlockCols = EIGEN_ENUM_MIN(MatrixType::ColsAtCompileTime,5); @@ -152,6 +151,14 @@ template<typename MatrixType> void submatrices(const MatrixType& m) m2.template diagonal<N2>() = 2 * m1.template diagonal<N2>(); m2.template diagonal<N2>()[0] *= 3; VERIFY_IS_APPROX(m2.template diagonal<N2>()[0], static_cast<Scalar>(6) * m1.template diagonal<N2>()[0]); + + m2.diagonal(N1) = 2 * m1.diagonal(N1); + m2.diagonal(N1)[0] *= 3; + VERIFY_IS_APPROX(m2.diagonal(N1)[0], static_cast<Scalar>(6) * m1.diagonal(N1)[0]); + + m2.diagonal(N2) = 2 * m1.diagonal(N2); + m2.diagonal(N2)[0] *= 3; + VERIFY_IS_APPROX(m2.diagonal(N2)[0], static_cast<Scalar>(6) * m1.diagonal(N2)[0]); } // stress some basic stuffs with block matrices |