Implement nonZeros() for Transpose<sparse>

This commit is contained in:
Gael Guennebaud 2014-07-01 11:49:46 +02:00
parent 7ffd55c980
commit 0ad7a644df

View File

@ -61,6 +61,17 @@ template<typename MatrixType> class TransposeImpl<MatrixType,Sparse>::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<typename MatrixType> class TransposeImpl<MatrixType,Sparse>
: public SparseMatrixBase<Transpose<MatrixType> >
{
protected:
typedef SparseMatrixBase<Transpose<MatrixType> > Base;
public:
inline typename MatrixType::Index nonZeros() const { return Base::derived().nestedExpression().nonZeros(); }
};
namespace internal {
template<typename ArgType>