aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseCore/SparseTriangularView.h
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-10-28 13:31:00 +0100
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-10-28 13:31:00 +0100
commitbd2d330b25f4f57b64ddc125c70dadd42e1e3349 (patch)
tree2367f58fafcc3f59106a6965d26de7ccdc718006 /Eigen/src/SparseCore/SparseTriangularView.h
parent79225db0b6ce73d3ab2a841cf33af031678d8815 (diff)
Temporary workaround for bug #875:
Let TriangularView<Sparse>::nonZeros() return nonZeros() of the nested expression
Diffstat (limited to 'Eigen/src/SparseCore/SparseTriangularView.h')
-rw-r--r--Eigen/src/SparseCore/SparseTriangularView.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Eigen/src/SparseCore/SparseTriangularView.h b/Eigen/src/SparseCore/SparseTriangularView.h
index 1f5e53155..e051f4486 100644
--- a/Eigen/src/SparseCore/SparseTriangularView.h
+++ b/Eigen/src/SparseCore/SparseTriangularView.h
@@ -50,6 +50,13 @@ protected:
template<typename OtherDerived> void solveInPlace(MatrixBase<OtherDerived>& other) const;
template<typename OtherDerived> void solveInPlace(SparseMatrixBase<OtherDerived>& other) const;
+
+ inline Index nonZeros() const {
+ // FIXME HACK number of nonZeros is required for product logic
+ // this returns only an upper bound (but should be OK for most purposes)
+ return derived().nestedExpression().nonZeros();
+ }
+
};