From 98f16a6ee73908f32d78bbbc8f93be39dd9bb8e2 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 13 Jul 2012 20:54:38 +0200 Subject: [PATCH] fix bug #485: conflict between a typedef and template type parameter (transplanted from 46b1c7a0ce3dcd726a4ea2393f4491d63e36cdd1 ) --- .../BasicPreconditioners.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h b/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h index 6ca7bd427..73ca9bfde 100644 --- a/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +++ b/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h @@ -37,12 +37,13 @@ class DiagonalPreconditioner typedef typename Vector::Index Index; public: + // this typedef is only to export the scalar type and compile-time dimensions to solve_retval typedef Matrix MatrixType; DiagonalPreconditioner() : m_isInitialized(false) {} - template - DiagonalPreconditioner(const MatrixType& mat) : m_invdiag(mat.cols()) + template + DiagonalPreconditioner(const MatType& mat) : m_invdiag(mat.cols()) { compute(mat); } @@ -50,19 +51,19 @@ class DiagonalPreconditioner Index rows() const { return m_invdiag.size(); } Index cols() const { return m_invdiag.size(); } - template - DiagonalPreconditioner& analyzePattern(const MatrixType& ) + template + DiagonalPreconditioner& analyzePattern(const MatType& ) { return *this; } - template - DiagonalPreconditioner& factorize(const MatrixType& mat) + template + DiagonalPreconditioner& factorize(const MatType& mat) { m_invdiag.resize(mat.cols()); for(int j=0; j - DiagonalPreconditioner& compute(const MatrixType& mat) + template + DiagonalPreconditioner& compute(const MatType& mat) { return factorize(mat); }