aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseCore/SparseVector.h
diff options
context:
space:
mode:
Diffstat (limited to 'Eigen/src/SparseCore/SparseVector.h')
-rw-r--r--Eigen/src/SparseCore/SparseVector.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Eigen/src/SparseCore/SparseVector.h b/Eigen/src/SparseCore/SparseVector.h
index 35bcec819..7b65f32bc 100644
--- a/Eigen/src/SparseCore/SparseVector.h
+++ b/Eigen/src/SparseCore/SparseVector.h
@@ -442,6 +442,10 @@ struct evaluator<SparseVector<_Scalar,_Options,_Index> >
explicit evaluator(const SparseVectorType &mat) : m_matrix(mat) {}
+ inline Index nonZerosEstimate() const {
+ return m_matrix.nonZeros();
+ }
+
operator SparseVectorType&() { return m_matrix.const_cast_derived(); }
operator const SparseVectorType&() const { return m_matrix; }