diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-06-17 10:16:15 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-06-17 10:16:15 +0200 |
commit | 6bff339cc59bba33fc192555fafc673684b95295 (patch) | |
tree | 0447c72083ea60f37f6b55e55d6a2efa8820524c /test | |
parent | 43086d12d236fd7345e6260a2a9c2690de37205c (diff) |
add unit tests for other generalized variants
Diffstat (limited to 'test')
-rw-r--r-- | test/eigensolver_selfadjoint.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/eigensolver_selfadjoint.cpp b/test/eigensolver_selfadjoint.cpp index d3bbb3a7e..e8da32d22 100644 --- a/test/eigensolver_selfadjoint.cpp +++ b/test/eigensolver_selfadjoint.cpp @@ -117,10 +117,24 @@ template<typename MatrixType> void selfadjointeigensolver(const MatrixType& m) VERIFY_IS_APPROX(eiSymm.eigenvalues(), eiSymmNoEivecs.eigenvalues()); // generalized eigen problem Ax = lBx + eiSymmGen.compute(symmA, symmB,Ax_lBx); VERIFY_IS_EQUAL(eiSymmGen.info(), Success); VERIFY((symmA.template selfadjointView<Lower>() * eiSymmGen.eigenvectors()).isApprox( symmB.template selfadjointView<Lower>() * (eiSymmGen.eigenvectors() * eiSymmGen.eigenvalues().asDiagonal()), largerEps)); + // generalized eigen problem BAx = lx + eiSymmGen.compute(symmA, symmB,BAx_lx); + VERIFY_IS_EQUAL(eiSymmGen.info(), Success); + VERIFY((symmB.template selfadjointView<Lower>() * (symmA.template selfadjointView<Lower>() * eiSymmGen.eigenvectors())).isApprox( + (eiSymmGen.eigenvectors() * eiSymmGen.eigenvalues().asDiagonal()), largerEps)); + + // generalized eigen problem ABx = lx + eiSymmGen.compute(symmA, symmB,ABx_lx); + VERIFY_IS_EQUAL(eiSymmGen.info(), Success); + VERIFY((symmA.template selfadjointView<Lower>() * (symmB.template selfadjointView<Lower>() * eiSymmGen.eigenvectors())).isApprox( + (eiSymmGen.eigenvectors() * eiSymmGen.eigenvalues().asDiagonal()), largerEps)); + + MatrixType sqrtSymmA = eiSymm.operatorSqrt(); VERIFY_IS_APPROX(MatrixType(symmA.template selfadjointView<Lower>()), sqrtSymmA*sqrtSymmA); VERIFY_IS_APPROX(sqrtSymmA, symmA.template selfadjointView<Lower>()*eiSymm.operatorInverseSqrt()); |