mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user