scan

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

Inclusive or exclusive scan of an array. More...

## Functions
AFAPI array | scan (const array &in, const int dim=0, binaryOp op=AF_BINARY_ADD, bool inclusive_scan=true)
| C++ Interface generalized scan of an array. More...
AFAPI af_err | af_scan (af_array *out, const af_array in, const int dim, af_binary_op op, bool inclusive_scan)
| C Interface generalized scan of an array. More...

## Detailed Description

Inclusive or exclusive scan of an array.

Perform inclusive or exclusive scan using a given binary operation along a given dimension.

Binary operations can be add, mul, min, max as defined by af_binary_op.

## Function Documentation

## ◆ af_scan()

AFAPI af_err af_scan | ( | af_array * | out,
|  | const af_array | in,
|  | const int | dim,
|  | af_binary_op | op,
|  | bool | inclusive_scan
| ) |  |

C Interface generalized scan of an array.

Parameters

  [out] | out | will contain scan of the input
  [in] | in | is the input array
  [in] | dim | The dimension along which scan is performed
  [in] | op | is the type of binary operations used
  [in] | inclusive_scan | is flag specifying whether scan is inclusive

Returns
  AF_SUCCESS if the execution completes properly

## ◆ scan()

AFAPI array af::scan | ( | const array & | in,
|  | const int | dim = `0`,
|  | binaryOp | op = `AF_BINARY_ADD`,
|  | bool | inclusive_scan = `true`
| ) |  |

C++ Interface generalized scan of an array.

Parameters

  [in] | in | is the input array
  [in] | dim | The dimension along which scan is performed
  [in] | op | is the type of binary operation used
  [in] | inclusive_scan | is flag specifying whether scan is inclusive

Returns
  the output containing scan of the input

Examples:
  helloworld/helloworld.cpp.