\returns the number of non zero coefficients */
| 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. |
no test coverage detected