where

- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
where
Complete List of ArrayFire Functions ArrayFire Functions by Category » Vector Algorithms » | Inclusive scan operations

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. 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

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] | idx | will contain indices where `in` is non-zero
  [in] | in | is the input array.

Returns
  AF_SUCCESS if the execution completes properly

AFAPI array af::where | ( | const array & | in | ) |

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

Parameters

  [in] | in | is the input array.

Returns
  linear indices where `in` is non-zero

Examples:
  binary_thresholding.cpp, and naive_bayes.cpp.