A high-performance general-purpose compute library

Locate the indices of non-zero elements. More...

Functions

AFAPI array where (const array &in)
 C++ Interface for finding the locations of non-zero values in an array.
 
AFAPI af_err af_where (af_array *idx, const af_array in)
 C Interface for finding the locations of non-zero values in an array.
 

Detailed Description

Locate the indices of non-zero elements.

Return type is u32 for all input types

The locations are provided by flattening the input into a linear array.

Function Documentation

◆ af_where()

AFAPI af_err af_where ( af_array idx,
const af_array  in 
)

C Interface for finding the locations of non-zero values in an array.

Parameters
[out]idxwill contain indices where in is non-zero
[in]inis the input array.
Returns
AF_SUCCESS if the execution completes properly

◆ where()

AFAPI array where ( const array in)

C++ Interface for finding the locations of non-zero values in an array.

Parameters
[in]inis the input array.
Returns
linear indices where in is non-zero