A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
sparseGetNNZ
ArrayFire Functions | ArrayFire Functions by Category » Linear Algebra » Sparse functions

Returns the number of non zero elements in the sparse array More...

## Functions
AFAPI dim_t | sparseGetNNZ (const array in)
AFAPI af_err | af_sparse_get_nnz (dim_t *out, const af_array in)

## Detailed Description

Returns the number of non zero elements in the sparse array

This is always equal to the size of the values array.

## Function Documentation

## ◆ af_sparse_get_nnz()

AFAPI af_err af_sparse_get_nnz | ( | dim_t * | out,
|  | const af_array | in )

Parameters

  [out] | out | the number of non-zero elements of the sparse array
  [in] | in | is the input sparse matrix

Returns
  AF_SUCCESS if the execution completes properly

## ◆ sparseGetNNZ()

AFAPI dim_t sparseGetNNZ | ( | const array | in | ) |

Parameters

  [in] | in | is the input sparse matrix

Returns
  the number of non-zero elements of the sparse array