diff options
author | Gael Guennebaud <g.gael@free.fr> | 2008-06-28 23:07:14 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2008-06-28 23:07:14 +0000 |
commit | 027818d7392dbb4f12db17bb9f35032727bb1a30 (patch) | |
tree | 437f31b0b222f9ad4d8e6351ba8dc6a0e00f1b8b /test/cholesky.cpp | |
parent | 6917be911311428567bbde2a5db430d8c2c9ef96 (diff) |
* added innerSize / outerSize functions to MatrixBase
* added complete implementation of sparse matrix product
(with a little glue in Eigen/Core)
* added an exhaustive bench of sparse products including GMM++ and MTL4
=> Eigen outperforms in all transposed/density configurations !
Diffstat (limited to 'test/cholesky.cpp')
-rw-r--r-- | test/cholesky.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/cholesky.cpp b/test/cholesky.cpp index 2f18771c2..4c02b4124 100644 --- a/test/cholesky.cpp +++ b/test/cholesky.cpp @@ -24,6 +24,7 @@ #include "main.h" #include <Eigen/Cholesky> +#include <Eigen/LU> template<typename MatrixType> void cholesky(const MatrixType& m) { @@ -34,12 +35,12 @@ template<typename MatrixType> void cholesky(const MatrixType& m) int cols = m.cols(); typedef typename MatrixType::Scalar Scalar; - typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, MatrixType::ColsAtCompileTime> SquareMatrixType; - typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, 1> VectorType; + typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType; + typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType; - MatrixType a = MatrixType::random(rows,cols).transpose(); - VectorType b = VectorType::random(cols); - SquareMatrixType covMat = a.adjoint() * a; + MatrixType a = MatrixType::random(rows,cols); + VectorType b = VectorType::random(rows); + SquareMatrixType covMat = a * a.adjoint(); CholeskyWithoutSquareRoot<SquareMatrixType> cholnosqrt(covMat); VERIFY_IS_APPROX(covMat, cholnosqrt.matrixL() * cholnosqrt.vectorD().asDiagonal() * cholnosqrt.matrixL().adjoint()); |