Make MatrixFunctions tests more robust.

* Use absolute error instead of relative error.
* Test on well-conditioned matrices.
* Do not repeat the same test g_repeat times (bug fix).
* Correct diagnostic output in matrix_exponential.cpp .
This commit is contained in:
Jitse Niesen
2010-03-01 12:05:57 +00:00
parent f1f3c30ddc
commit 2d7bd1ec91
2 changed files with 42 additions and 32 deletions

View File

@@ -133,7 +133,7 @@ void randomTest(const MatrixType& m, double tol)
m1 = MatrixType::Random(rows, cols);
m2 = ei_matrix_function(m1, expfn) * ei_matrix_function(-m1, expfn);
std::cout << "randomTest: error funm = " << relerr(identity, m2 * m3);
std::cout << "randomTest: error funm = " << relerr(identity, m2);
VERIFY(identity.isApprox(m2, static_cast<RealScalar>(tol)));
m2 = ei_matrix_exponential(m1) * ei_matrix_exponential(-m1);