A high-performance general-purpose compute library

Locate the indices of the non-zero values in an array. More...

Functions

array where (const array &in)
 C++ Interface to locate the indices of the non-zero values in an array.
af_err af_where (af_array *idx, const af_array in)
 C Interface to locate the indices of the non-zero values in an array.

Detailed Description

Locate the indices of the non-zero values in an array.

Output type is u32.

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

Function Documentation

◆ af_where()

af_err af_where ( af_array * idx,
const af_array in )

C Interface to locate the indices of the non-zero values in an array.

Parameters
[out]idxlinear indices where in is non-zero
[in]ininput array
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ where()

array where ( const array & in)

C++ Interface to locate the indices of the non-zero values in an array.

Parameters
[in]ininput array
Returns
linear indices where in is non-zero
Examples
computer_vision/harris.cpp, image_processing/binary_thresholding.cpp, machine_learning/geneticalgorithm.cpp, and machine_learning/naive_bayes.cpp.