MCPcopy Create free account
hub / github.com/PX4/eigen / nonZeros

Method nonZeros

Eigen/src/SparseCore/SparseCompressedBase.h:56–66  ·  view source on GitHub ↗

\returns the number of non zero coefficients */

Source from the content-addressed store, hash-verified

54
55 /** \returns the number of non zero coefficients */
56 inline Index nonZeros() const
57 {
58 if(Derived::IsVectorAtCompileTime && outerIndexPtr()==0)
59 return derived().nonZeros();
60 else if(isCompressed())
61 return outerIndexPtr()[derived().outerSize()]-outerIndexPtr()[0];
62 else if(derived().outerSize()==0)
63 return 0;
64 else
65 return innerNonZeros().sum();
66 }
67
68 /** \returns a const pointer to the array of values.
69 * This function is aimed at interoperability with other libraries.

Callers 3

InnerIteratorMethod · 0.45
ReverseInnerIteratorMethod · 0.45
nonZerosEstimateMethod · 0.45

Calls 2

outerSizeMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected