From 9be658f7015161989b7ecccd70fd050ce563cad9 Mon Sep 17 00:00:00 2001 From: Chen-Pang He Date: Mon, 15 Jul 2013 00:43:14 +0800 Subject: generateTestMatrix can use processTriangularMatrix --- unsupported/test/matrix_power.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'unsupported/test/matrix_power.cpp') diff --git a/unsupported/test/matrix_power.cpp b/unsupported/test/matrix_power.cpp index 3ee19fc56..849e4287b 100644 --- a/unsupported/test/matrix_power.cpp +++ b/unsupported/test/matrix_power.cpp @@ -96,33 +96,6 @@ void testGeneral(const MatrixType& m, double tol) } } -// For complex matrices, any matrix is fine. -template::Scalar>::IsComplex> -struct processTriangularMatrix -{ - static void run(MatrixType&, MatrixType&, const MatrixType&) - { } -}; - -// For real matrices, make sure none of the eigenvalues are negative. -template -struct processTriangularMatrix -{ - static void run(MatrixType& m, MatrixType& T, const MatrixType& U) - { - typedef typename MatrixType::Index Index; - const Index size = m.cols(); - - for (Index i=0; i < size; ++i) { - if (i == size - 1 || T.coeff(i+1,i) == 0) - T.coeffRef(i,i) = std::abs(T.coeff(i,i)); - else - ++i; - } - m = U * T * U.adjoint(); - } -}; - template void testSingular(MatrixType m, double tol) { -- cgit v1.2.3