From 0ad7a644df5c71b9a75c0300210ce17985b88044 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 1 Jul 2014 11:49:46 +0200 Subject: [PATCH] Implement nonZeros() for Transpose --- Eigen/src/SparseCore/SparseTranspose.h | 11 +++++++++++ 1 file changed, 11 insertions(+) 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