aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/matrix_exponential.cpp
diff options
context:
space:
mode:
authorGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-03-16 17:26:55 +0000
committerGravatar Jitse Niesen <jitse@maths.leeds.ac.uk>2010-03-16 17:26:55 +0000
commit04a4e22c58a21e084e088e1f64d3b2f8e134debb (patch)
tree34dafc16b7fac88c12d6363ef94769c91322df2d /unsupported/test/matrix_exponential.cpp
parentd536fef1bb44280bb96bbdc5418c033f17f982a8 (diff)
API change: ei_matrix_exponential(A) --> A.exp(), etc
Diffstat (limited to 'unsupported/test/matrix_exponential.cpp')
-rw-r--r--unsupported/test/matrix_exponential.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/unsupported/test/matrix_exponential.cpp b/unsupported/test/matrix_exponential.cpp
index 61f30334d..66e52e100 100644
--- a/unsupported/test/matrix_exponential.cpp
+++ b/unsupported/test/matrix_exponential.cpp
@@ -57,11 +57,11 @@ void test2dRotation(double tol)
angle = static_cast<T>(pow(10, i / 5. - 2));
B << cos(angle), sin(angle), -sin(angle), cos(angle);
- C = ei_matrix_function(angle*A, expfn);
+ C = (angle*A).matrixFunction(expfn);
std::cout << "test2dRotation: i = " << i << " error funm = " << relerr(C, B);
VERIFY(C.isApprox(B, static_cast<T>(tol)));
- C = ei_matrix_exponential(angle*A);
+ C = (angle*A).exp();
std::cout << " error expm = " << relerr(C, B) << "\n";
VERIFY(C.isApprox(B, static_cast<T>(tol)));
}
@@ -82,11 +82,11 @@ void test2dHyperbolicRotation(double tol)
A << 0, angle*imagUnit, -angle*imagUnit, 0;
B << ch, sh*imagUnit, -sh*imagUnit, ch;
- C = ei_matrix_function(A, expfn);
+ C = A.matrixFunction(expfn);
std::cout << "test2dHyperbolicRotation: i = " << i << " error funm = " << relerr(C, B);
VERIFY(C.isApprox(B, static_cast<T>(tol)));
- C = ei_matrix_exponential(A);
+ C = A.exp();
std::cout << " error expm = " << relerr(C, B) << "\n";
VERIFY(C.isApprox(B, static_cast<T>(tol)));
}
@@ -106,11 +106,11 @@ void testPascal(double tol)
for (int j=0; j<=i; j++)
B(i,j) = static_cast<T>(binom(i,j));
- C = ei_matrix_function(A, expfn);
+ C = A.matrixFunction(expfn);
std::cout << "testPascal: size = " << size << " error funm = " << relerr(C, B);
VERIFY(C.isApprox(B, static_cast<T>(tol)));
- C = ei_matrix_exponential(A);
+ C = A.exp();
std::cout << " error expm = " << relerr(C, B) << "\n";
VERIFY(C.isApprox(B, static_cast<T>(tol)));
}
@@ -132,11 +132,11 @@ void randomTest(const MatrixType& m, double tol)
for(int i = 0; i < g_repeat; i++) {
m1 = MatrixType::Random(rows, cols);
- m2 = ei_matrix_function(m1, expfn) * ei_matrix_function(-m1, expfn);
+ m2 = m1.matrixFunction(expfn) * (-m1).matrixFunction(expfn);
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);
+ m2 = m1.exp() * (-m1).exp();
std::cout << " error expm = " << relerr(identity, m2) << "\n";
VERIFY(identity.isApprox(m2, static_cast<RealScalar>(tol)));
}