mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #875: remove broken SparseMatrixBase::nonZeros and introduce a nonZerosEstimate() method to sparse evaluators for internal uses.
Factorize some code in SparseCompressedBase.
This commit is contained in:
@@ -50,13 +50,6 @@ 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();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -191,6 +184,10 @@ public:
|
||||
|
||||
explicit unary_evaluator(const XprType &xpr) : m_argImpl(xpr.nestedExpression()) {}
|
||||
|
||||
inline Index nonZerosEstimate() const {
|
||||
return m_argImpl.nonZerosEstimate();
|
||||
}
|
||||
|
||||
class InnerIterator : public EvalIterator
|
||||
{
|
||||
typedef EvalIterator Base;
|
||||
|
||||
Reference in New Issue
Block a user