diff options
author | Gael Guennebaud <g.gael@free.fr> | 2012-06-12 13:12:47 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2012-06-12 13:12:47 +0200 |
commit | 88e051019b90e539474596d8c4f284b3b57e17cd (patch) | |
tree | 8c600ae5bf028e5af57239b5d6356579512cf874 /test/nomalloc.cpp | |
parent | cd48254a879085557390f731850cd4924e9495b0 (diff) |
extend nomalloc unit test to test the solve calls
Diffstat (limited to 'test/nomalloc.cpp')
-rw-r--r-- | test/nomalloc.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp index 273b1f7ad..1d1f0c5ff 100644 --- a/test/nomalloc.cpp +++ b/test/nomalloc.cpp @@ -129,13 +129,20 @@ void ctms_decompositions() 0, maxSize, maxSize> ComplexMatrix; - const Matrix A(Matrix::Random(size, size)); + const Matrix A(Matrix::Random(size, size)), B(Matrix::Random(size, size)); + Matrix X(size,size); const ComplexMatrix complexA(ComplexMatrix::Random(size, size)); const Matrix saA = A.adjoint() * A; + const Vector b(Vector::Random(size)); + Vector x(size); // Cholesky module Eigen::LLT<Matrix> LLT; LLT.compute(A); + X = LLT.solve(B); + x = LLT.solve(b); Eigen::LDLT<Matrix> LDLT; LDLT.compute(A); + X = LDLT.solve(B); + x = LDLT.solve(b); // Eigenvalues module Eigen::HessenbergDecomposition<ComplexMatrix> hessDecomp; hessDecomp.compute(complexA); @@ -147,12 +154,22 @@ void ctms_decompositions() // LU module Eigen::PartialPivLU<Matrix> ppLU; ppLU.compute(A); + X = ppLU.solve(B); + x = ppLU.solve(b); Eigen::FullPivLU<Matrix> fpLU; fpLU.compute(A); + X = fpLU.solve(B); + x = fpLU.solve(b); // QR module Eigen::HouseholderQR<Matrix> hQR; hQR.compute(A); + X = hQR.solve(B); + x = hQR.solve(b); Eigen::ColPivHouseholderQR<Matrix> cpQR; cpQR.compute(A); + X = cpQR.solve(B); + x = cpQR.solve(b); Eigen::FullPivHouseholderQR<Matrix> fpQR; fpQR.compute(A); + X = fpQR.solve(B); + x = fpQR.solve(b); // SVD module Eigen::JacobiSVD<Matrix> jSVD; jSVD.compute(A, ComputeFullU | ComputeFullV); |