diff --git a/Eigen/src/SparseCore/SparseMatrixBase.h b/Eigen/src/SparseCore/SparseMatrixBase.h index d76dfa33d..55b0ad9d2 100644 --- a/Eigen/src/SparseCore/SparseMatrixBase.h +++ b/Eigen/src/SparseCore/SparseMatrixBase.h @@ -97,7 +97,6 @@ template class SparseMatrixBase : public EigenBase Transpose >::type AdjointReturnType; typedef Transpose TransposeReturnType; - template struct SelfAdjointViewReturnType { typedef SelfAdjointView Type; }; typedef typename internal::add_const >::type ConstTransposeReturnType; // FIXME storage order do not match evaluator storage order @@ -300,9 +299,14 @@ template class SparseMatrixBase : public EigenBase template inline const TriangularView triangularView() const; + + template struct SelfAdjointViewReturnType { typedef SparseSelfAdjointView Type; }; + template struct ConstSelfAdjointViewReturnType { typedef const SparseSelfAdjointView Type; }; - template inline const SparseSelfAdjointView selfadjointView() const; - template inline SparseSelfAdjointView selfadjointView(); + template inline + typename ConstSelfAdjointViewReturnType::Type selfadjointView() const; + template inline + typename SelfAdjointViewReturnType::Type selfadjointView(); template Scalar dot(const MatrixBase& other) const; template Scalar dot(const SparseMatrixBase& other) const; diff --git a/Eigen/src/SparseCore/SparseSelfAdjointView.h b/Eigen/src/SparseCore/SparseSelfAdjointView.h index 6467d4894..3da856799 100644 --- a/Eigen/src/SparseCore/SparseSelfAdjointView.h +++ b/Eigen/src/SparseCore/SparseSelfAdjointView.h @@ -169,17 +169,17 @@ template class SparseSelfAdjointView ***************************************************************************/ template -template -const SparseSelfAdjointView SparseMatrixBase::selfadjointView() const +template +typename SparseMatrixBase::template ConstSelfAdjointViewReturnType::Type SparseMatrixBase::selfadjointView() const { - return SparseSelfAdjointView(derived()); + return SparseSelfAdjointView(derived()); } template -template -SparseSelfAdjointView SparseMatrixBase::selfadjointView() +template +typename SparseMatrixBase::template SelfAdjointViewReturnType::Type SparseMatrixBase::selfadjointView() { - return SparseSelfAdjointView(derived()); + return SparseSelfAdjointView(derived()); } /***************************************************************************