aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseCore/SparseTranspose.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-07-01 11:49:46 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-07-01 11:49:46 +0200
commit0ad7a644df5c71b9a75c0300210ce17985b88044 (patch)
tree3dae5fe9037cf8a6061543e3d5091763a631a44f /Eigen/src/SparseCore/SparseTranspose.h
parent7ffd55c98034964f735e7d6f11c01dcc2cf883ee (diff)
Implement nonZeros() for Transpose<sparse>
Diffstat (limited to 'Eigen/src/SparseCore/SparseTranspose.h')
-rw-r--r--Eigen/src/SparseCore/SparseTranspose.h11
1 files changed, 11 insertions, 0 deletions
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<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>