From 2120fed849e1d00724694a2c8a041ec5561c750b Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Sat, 23 Aug 2008 15:14:20 +0000 Subject: * bug fixes in: Dot, generalized eigen problem, singular matrix detetection in Cholesky * fix all numerical instabilies in the unit tests, now all tests can be run 2000 times with almost zero failures. --- test/inverse.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test/inverse.cpp') diff --git a/test/inverse.cpp b/test/inverse.cpp index de6b09621..eaa7bfd3f 100644 --- a/test/inverse.cpp +++ b/test/inverse.cpp @@ -35,13 +35,21 @@ template void inverse(const MatrixType& m) int cols = m.cols(); typedef typename MatrixType::Scalar Scalar; + typedef typename NumTraits::Real RealScalar; typedef Matrix VectorType; MatrixType m1 = test_random_matrix(rows, cols), - m2 = test_random_matrix(rows, cols), + m2(rows, cols), mzero = MatrixType::Zero(rows, cols), identity = MatrixType::Identity(rows, rows); + if (ei_is_same_type::ret) + { + // let's build a more stable to inverse matrix + MatrixType a = test_random_matrix(rows,cols); + m1 += m1 * m1.adjoint() + a * a.adjoint(); + } + m2 = m1.inverse(); VERIFY_IS_APPROX(m1, m2.inverse() ); -- cgit v1.2.3