Functions

AFAPI array where (const array &in)
 C++ Interface for finding the locations of non-zero values in an array. More...
 
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. More...
 

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 af::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
Examples
computer_vision/harris.cpp, image_processing/binary_thresholding.cpp, machine_learning/geneticalgorithm.cpp, and machine_learning/naive_bayes.cpp.