diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-01-05 15:38:20 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-01-05 15:38:20 +0100 |
commit | 39209edd713a20bfb325796f8eafdc8194eed38e (patch) | |
tree | 97e44663ba5d310af81fadabfa73fbef028487df /unsupported/test/matrix_exponential.cpp | |
parent | cab85218db9d4e22f2940f34f4cb2e5f5032f6a9 (diff) |
port unsupported modules to new API
Diffstat (limited to 'unsupported/test/matrix_exponential.cpp')
-rw-r--r-- | unsupported/test/matrix_exponential.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/unsupported/test/matrix_exponential.cpp b/unsupported/test/matrix_exponential.cpp index f155e5f98..a5b40adde 100644 --- a/unsupported/test/matrix_exponential.cpp +++ b/unsupported/test/matrix_exponential.cpp @@ -25,7 +25,7 @@ #include "main.h" #include <unsupported/Eigen/MatrixFunctions> -double binom(int n, int k) +double binom(int n, int k) { double res = 1; for (int i=0; i<k; i++) @@ -36,7 +36,7 @@ double binom(int n, int k) template <typename Derived, typename OtherDerived> double relerr(const MatrixBase<Derived>& A, const MatrixBase<OtherDerived>& B) { - return std::sqrt((A - B).cwise().abs2().sum() / std::min(A.cwise().abs2().sum(), B.cwise().abs2().sum())); + return std::sqrt((A - B).cwiseAbs2().sum() / std::min(A.cwiseAbs2().sum(), B.cwiseAbs2().sum())); } template <typename T> @@ -52,7 +52,7 @@ void test2dRotation(double tol) T angle; A << 0, 1, -1, 0; - for (int i=0; i<=20; i++) + for (int i=0; i<=20; i++) { angle = static_cast<T>(pow(10, i / 5. - 2)); B << cos(angle), sin(angle), -sin(angle), cos(angle); @@ -74,7 +74,7 @@ void test2dHyperbolicRotation(double tol) std::complex<T> imagUnit(0,1); T angle, ch, sh; - for (int i=0; i<=20; i++) + for (int i=0; i<=20; i++) { angle = static_cast<T>((i-10) / 2.0); ch = std::cosh(angle); @@ -116,7 +116,7 @@ void testPascal(double tol) } } -template<typename MatrixType> +template<typename MatrixType> void randomTest(const MatrixType& m, double tol) { /* this test covers the following files: @@ -157,7 +157,7 @@ void test_matrix_exponential() CALL_SUBTEST_3(randomTest(Matrix4cd(), 1e-13)); CALL_SUBTEST_4(randomTest(MatrixXd(8,8), 1e-13)); CALL_SUBTEST_1(randomTest(Matrix2f(), 1e-4)); - CALL_SUBTEST_5(randomTest(Matrix3cf(), 1e-4)); + CALL_SUBTEST_5(randomTest(Matrix3cf(), 1e-4)); CALL_SUBTEST_1(randomTest(Matrix4f(), 1e-4)); CALL_SUBTEST_6(randomTest(MatrixXf(8,8), 1e-4)); } |