From bfaa7f4ffeb55f91278d70cd56659ce866e6ef88 Mon Sep 17 00:00:00 2001 From: Chen-Pang He Date: Mon, 27 Aug 2012 22:48:37 +0100 Subject: Add test for matrix power. Use Christoph Hertzberg's suggestion to use exponent laws. --- unsupported/test/matrix_exponential.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'unsupported/test/matrix_exponential.cpp') 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 +#include "matrix_functions.h" double binom(int n, int k) { @@ -18,12 +17,6 @@ double binom(int n, int k) return res; } -template -double relerr(const MatrixBase& A, const MatrixBase& B) -{ - return std::sqrt((A - B).cwiseAbs2().sum() / (std::min)(A.cwiseAbs2().sum(), B.cwiseAbs2().sum())); -} - template 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::Scalar>::Real RealScalar; -- cgit v1.2.3