diff options
author | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2010-02-17 09:50:11 +0000 |
---|---|---|
committer | Jitse Niesen <jitse@maths.leeds.ac.uk> | 2010-02-17 09:50:11 +0000 |
commit | 39d9f0275b8c9ef515b04f7b0e51f701edabbcad (patch) | |
tree | 00fb39cd5c792255bb43fca28b3165f01faa20eb /unsupported/test/matrix_exponential.cpp | |
parent | 2cd1ad2dede6a389f5e5b819195ca633b2110c90 (diff) |
Update matrix_exponential test after API change in ei_matrix_function
Apologies for forgetting this yesterday and not testing properly.
Diffstat (limited to 'unsupported/test/matrix_exponential.cpp')
-rw-r--r-- | unsupported/test/matrix_exponential.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/unsupported/test/matrix_exponential.cpp b/unsupported/test/matrix_exponential.cpp index 6150439c5..86e942edb 100644 --- a/unsupported/test/matrix_exponential.cpp +++ b/unsupported/test/matrix_exponential.cpp @@ -57,7 +57,7 @@ void test2dRotation(double tol) angle = static_cast<T>(pow(10, i / 5. - 2)); B << cos(angle), sin(angle), -sin(angle), cos(angle); - ei_matrix_function(angle*A, expfn, &C); + C = ei_matrix_function(angle*A, expfn); std::cout << "test2dRotation: i = " << i << " error funm = " << relerr(C, B); VERIFY(C.isApprox(B, static_cast<T>(tol))); @@ -82,7 +82,7 @@ void test2dHyperbolicRotation(double tol) A << 0, angle*imagUnit, -angle*imagUnit, 0; B << ch, sh*imagUnit, -sh*imagUnit, ch; - ei_matrix_function(A, expfn, &C); + C = ei_matrix_function(A, expfn); std::cout << "test2dHyperbolicRotation: i = " << i << " error funm = " << relerr(C, B); VERIFY(C.isApprox(B, static_cast<T>(tol))); @@ -106,7 +106,7 @@ void testPascal(double tol) for (int j=0; j<=i; j++) B(i,j) = static_cast<T>(binom(i,j)); - ei_matrix_function(A, expfn, &C); + C = ei_matrix_function(A, expfn); std::cout << "testPascal: size = " << size << " error funm = " << relerr(C, B); VERIFY(C.isApprox(B, static_cast<T>(tol))); @@ -132,10 +132,9 @@ void randomTest(const MatrixType& m, double tol) for(int i = 0; i < g_repeat; i++) { m1 = MatrixType::Random(rows, cols); - ei_matrix_function(m1, expfn, &m2); - ei_matrix_function(-m1, expfn, &m3); + m2 = ei_matrix_function(m1, expfn) * ei_matrix_function(-m1, expfn); std::cout << "randomTest: error funm = " << relerr(identity, m2 * m3); - VERIFY(identity.isApprox(m2 * m3, static_cast<RealScalar>(tol))); + VERIFY(identity.isApprox(m2, static_cast<RealScalar>(tol))); m2 = ei_matrix_exponential(m1) * ei_matrix_exponential(-m1); std::cout << " error expm = " << relerr(identity, m2) << "\n"; |