diff --git a/Eigen/src/SparseCore/SparseTranspose.h b/Eigen/src/SparseCore/SparseTranspose.h index b20843dd3..f5eff6133 100644 --- a/Eigen/src/SparseCore/SparseTranspose.h +++ b/Eigen/src/SparseCore/SparseTranspose.h @@ -61,6 +61,17 @@ template class TransposeImpl::ReverseInn #else // EIGEN_TEST_EVALUATORS +// Implement nonZeros() for transpose. I'm not sure that's the best approach for that. +// Perhaps it should be implemented in Transpose<> itself. +template class TransposeImpl + : public SparseMatrixBase > +{ + protected: + typedef SparseMatrixBase > Base; + public: + inline typename MatrixType::Index nonZeros() const { return Base::derived().nestedExpression().nonZeros(); } +}; + namespace internal { template