diff options
author | Gael Guennebaud <g.gael@free.fr> | 2008-04-27 14:05:40 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2008-04-27 14:05:40 +0000 |
commit | 64bacf1c3f925b38c951007631ec75aac8d8e0e9 (patch) | |
tree | af7b2b31b79e1ee57c1f9f2c386fa24021e90c2b /test/cholesky.cpp | |
parent | 4ffffa670ed70f2ede9a7c71c91bbbc249239e2b (diff) |
* added ei_sqrt for complex
* updated Cholesky to support complex
* correct result_type for abs and abs2 functors
Diffstat (limited to 'test/cholesky.cpp')
-rw-r--r-- | test/cholesky.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/cholesky.cpp b/test/cholesky.cpp index 3d8351d8c..f4367ba6e 100644 --- a/test/cholesky.cpp +++ b/test/cholesky.cpp @@ -42,14 +42,15 @@ template<typename MatrixType> void cholesky(const MatrixType& m) MatrixType a = MatrixType::random(rows,cols).transpose(); VectorType b = VectorType::random(cols); - SquareMatrixType covMat = a.transpose() * a; + SquareMatrixType covMat = a.adjoint() * a; CholeskyWithoutSquareRoot<SquareMatrixType> cholnosqrt(covMat); - VERIFY_IS_APPROX(covMat, cholnosqrt.matrixU().transpose() * cholnosqrt.vectorD().asDiagonal() * cholnosqrt.matrixU()); + VERIFY_IS_APPROX(covMat, cholnosqrt.matrixL() * cholnosqrt.vectorD().asDiagonal() * cholnosqrt.matrixL().adjoint()); VERIFY_IS_APPROX(covMat * cholnosqrt.solve(b), b); + Cholesky<SquareMatrixType> chol(covMat); - VERIFY_IS_APPROX(covMat, chol.matrixU().transpose() * chol.matrixU()); + VERIFY_IS_APPROX(covMat, chol.matrixL() * chol.matrixL().adjoint()); VERIFY_IS_APPROX(covMat * chol.solve(b), b); } @@ -58,7 +59,7 @@ void EigenTest::testCholesky() for(int i = 0; i < 1; i++) { cholesky(Matrix3f()); cholesky(Matrix4d()); - cholesky(MatrixXd(17,17)); + cholesky(MatrixXcd(7,7)); } } |