diff options
author | Rasmus Munk Larsen <rmlarsen@google.com> | 2016-04-01 16:19:45 -0700 |
---|---|---|
committer | Rasmus Munk Larsen <rmlarsen@google.com> | 2016-04-01 16:19:45 -0700 |
commit | f54137606eb6d68cbafd10d90013e254b26137ed (patch) | |
tree | bfb7752ec5bd7d6334c7fb139a898e148b203327 /test/lu.cpp | |
parent | fb8dccc23e5f717319c230c2701a5fbf1d3c3975 (diff) |
Add condition estimation to Cholesky (LLT) factorization.
Diffstat (limited to 'test/lu.cpp')
-rw-r--r-- | test/lu.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/lu.cpp b/test/lu.cpp index 9e8059f58..53b3fcee4 100644 --- a/test/lu.cpp +++ b/test/lu.cpp @@ -151,10 +151,11 @@ template<typename MatrixType> void lu_invertible() MatrixType m1_inverse = lu.inverse(); VERIFY_IS_APPROX(m2, m1_inverse*m3); - // Test condition number estimation. + // Verify that the estimated condition number is within a factor of 10 of the + // truth. RealScalar rcond = (RealScalar(1) / matrix_l1_norm(m1)) / matrix_l1_norm(m1_inverse); - // Verify that the estimate is within a factor of 10 of the truth. - VERIFY(lu.rcond() > rcond / 10 && lu.rcond() < rcond * 10); + const RealScalar rcond_est = lu.rcond(); + VERIFY(rcond_est > rcond / 10 && rcond_est < rcond * 10); // test solve with transposed lu.template _solve_impl_transposed<false>(m3, m2); @@ -199,7 +200,8 @@ template<typename MatrixType> void lu_partial_piv() // Test condition number estimation. RealScalar rcond = (RealScalar(1) / matrix_l1_norm(m1)) / matrix_l1_norm(m1_inverse); // Verify that the estimate is within a factor of 10 of the truth. - VERIFY(plu.rcond() > rcond / 10 && plu.rcond() < rcond * 10); + const RealScalar rcond_est = plu.rcond(); + VERIFY(rcond_est > rcond / 10 && rcond_est < rcond * 10); // test solve with transposed plu.template _solve_impl_transposed<false>(m3, m2); |