![]() Registered Member ![]()
|
The name of this function implies that it returns the number of non-zero elements in the array. The documentation says that, too. In reality, it returns the total number of elements in the array, including any zeros.
|
![]() Registered Member ![]()
|
To documentation says:
>the number of nonzero coefficients which is in practice the number of stored coefficients. So this implies that all, including zero coefficients, are counted. |
![]() Moderator ![]()
|
To count the number of numerical non-zeros, you can do either:
- (mat.array() != 0).count() - mat.sparseView().nonZeros() |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]