Do more. Code less. Free software for GPU computing.
<scroll to top>

Index or count nonzero elements

Data Analysis

array where (const array &input)
 indices where nonzero
void where (array &row, array &column, const array &input)
 row and column indices of nonzero elements in input
unsigned count (const array &input)
 count nonzero elements in input

Function Documentation

array af::where ( const array &  input)

indices where nonzero

Parameters:
[in]input
Returns:
[out] indices of nonzero elements
void af::where ( array &  row,
array &  column,
const array &  input 
)

row and column indices of nonzero elements in input

Parameters:
[in]input
[out]row
[out]column
unsigned af::count ( const array &  input)

count nonzero elements in input

Parameters:
[in]input
Returns:
The number of nonzero elements in input
Examples:
examples/image/gfor_hist_demo.cpp, examples/misc/blas.cpp, and examples/pi/pi.cpp.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines