diff options
author | Chen-Pang He <jdh8@ms63.hinet.net> | 2012-08-27 22:48:37 +0100 |
---|---|---|
committer | Chen-Pang He <jdh8@ms63.hinet.net> | 2012-08-27 22:48:37 +0100 |
commit | bfaa7f4ffeb55f91278d70cd56659ce866e6ef88 (patch) | |
tree | ba5e0e225845e2e4ad9d401dceb6bdb03be56dce /unsupported/test/matrix_exponential.cpp | |
parent | b55d260adaadaece9ed92973792c4cc846061881 (diff) |
Add test for matrix power.
Use Christoph Hertzberg's suggestion to use exponent laws.
Diffstat (limited to 'unsupported/test/matrix_exponential.cpp')
-rw-r--r-- | unsupported/test/matrix_exponential.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/unsupported/test/matrix_exponential.cpp b/unsupported/test/matrix_exponential.cpp index 695472f91..50dec083d 100644 --- a/unsupported/test/matrix_exponential.cpp +++ b/unsupported/test/matrix_exponential.cpp @@ -7,8 +7,7 @@ // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. -#include "main.h" -#include <unsupported/Eigen/MatrixFunctions> +#include "matrix_functions.h" double binom(int n, int k) { @@ -18,12 +17,6 @@ double binom(int n, int k) return res; } -template <typename Derived, typename OtherDerived> -double relerr(const MatrixBase<Derived>& A, const MatrixBase<OtherDerived>& B) -{ - return std::sqrt((A - B).cwiseAbs2().sum() / (std::min)(A.cwiseAbs2().sum(), B.cwiseAbs2().sum())); -} - template <typename T> T expfn(T x, int) { @@ -109,8 +102,7 @@ void randomTest(const MatrixType& m, double tol) */ typename MatrixType::Index rows = m.rows(); typename MatrixType::Index cols = m.cols(); - MatrixType m1(rows, cols), m2(rows, cols), m3(rows, cols), - identity = MatrixType::Identity(rows, rows); + MatrixType m1(rows, cols), m2(rows, cols), identity = MatrixType::Identity(rows, cols); typedef typename NumTraits<typename internal::traits<MatrixType>::Scalar>::Real RealScalar; |