diff --git a/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h b/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h index 11b8347f7..9e7dd1404 100644 --- a/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +++ b/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h @@ -185,7 +185,7 @@ public: { typedef typename internal::conditional&, - SparseSelfAdjointView, UpLo> + typename Ref::template ConstSelfAdjointViewReturnType::Type >::type MatrixWrapperType; m_iterations = Base::maxIterations(); m_error = Base::m_tolerance; diff --git a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h index 46bc0ac78..6477b9de2 100644 --- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h @@ -52,9 +52,9 @@ public: * this class becomes invalid. Call compute() to update it with the new * matrix A, or modify a copy of A. */ - template - explicit IterativeSolverBase(const SparseMatrixBase& A) - : mp_matrix(A) + template + explicit IterativeSolverBase(const EigenBase& A) + : mp_matrix(A.derived()) { init(); compute(mp_matrix); @@ -67,8 +67,8 @@ public: * Currently, this function mostly calls analyzePattern on the preconditioner. In the future * we might, for instance, implement column reordering for faster matrix vector products. */ - template - Derived& analyzePattern(const SparseMatrixBase& A) + template + Derived& analyzePattern(const EigenBase& A) { grab(A.derived()); m_preconditioner.analyzePattern(mp_matrix); @@ -87,8 +87,8 @@ public: * this class becomes invalid. Call compute() to update it with the new * matrix A, or modify a copy of A. */ - template - Derived& factorize(const SparseMatrixBase& A) + template + Derived& factorize(const EigenBase& A) { eigen_assert(m_analysisIsOk && "You must first call analyzePattern()"); grab(A.derived()); @@ -108,8 +108,8 @@ public: * this class becomes invalid. Call compute() to update it with the new * matrix A, or modify a copy of A. */ - template - Derived& compute(const SparseMatrixBase& A) + template + Derived& compute(const EigenBase& A) { grab(A.derived()); m_preconditioner.compute(mp_matrix); @@ -223,11 +223,11 @@ protected: m_tolerance = NumTraits::epsilon(); } - template - void grab(const SparseMatrixBase &A) + template + void grab(const EigenBase &A) { mp_matrix.~Ref(); - ::new (&mp_matrix) Ref(A); + ::new (&mp_matrix) Ref(A.derived()); } void grab(const Ref &A)