/*!
\page batch_detail_algo algorithm

This function performs the operation across all batches present in the input simultaneously.

*/


/**
\addtogroup arrayfire_func
@{
\defgroup reduce_func_sum sum

\ingroup reduce_mat

Find the sum of values in the input

This table defines the return value types for the corresponding input types

Input Type          | Output Type
--------------------|---------------------
f32, f64, c32, c64  | same as input
s32, u32, s64, u64  | same as input
s16                 | s32
u16, u8, b8         | u32

\copydoc batch_detail_algo



\defgroup reduce_func_product product

\ingroup reduce_mat

Find the product of values in the input

This table defines the return value types for the corresponding input types

Input Type          | Output Type
--------------------|---------------------
f32, f64, c32, c64  | same as input
s32, u32, s64, u64  | same as input
s16                 | s32
u16, u8, b8         | u32

\copydoc batch_detail_algo



\defgroup reduce_func_min min

\ingroup reduce_mat

Find the minimum values and their locations

\copydoc batch_detail_algo



\defgroup reduce_func_max max

\ingroup reduce_mat

Find the maximum values and their locations

\copydoc batch_detail_algo



\defgroup reduce_func_all_true alltrue

\ingroup reduce_mat

Find if of all of the values in input are true

Return type is b8 for all input types

\copydoc batch_detail_algo



\defgroup reduce_func_any_true anytrue

\ingroup reduce_mat

Find if of any of the values in input are true

Return type is b8 for all input types

\copydoc batch_detail_algo



\defgroup reduce_func_count count

\ingroup reduce_mat

Count the number of non-zero elements in the input

Return type is u32 for all input types

\copydoc batch_detail_algo



\defgroup scan_func_accum accum

\ingroup scan_mat

Calculate the cumulative sum (inclusive) along the specified dimension

For a 1D array \f$X\f$, the inclusive cumulative sum calculates \f$x_i =
\sum_{p=0}^{i}x_p\f$ for every \f$x \in X\f$. Here is a simple example for the
1D case:

\snippet test/scan.cpp ex_accum_1D

For 2D arrays (and higher dimensions), you can specify the dimension along which
the cumulative sum will be calculated. Thus, the formula above will be
calculated for all array slices along the specified dimension (in the 2D case
for example, this looks like \f$x_{i,j} = \sum_{p=0}^{j}x_{i,p}\f$ if the second
dimension (dim1) was chosen). If no dimension is specified, then the first
dimension (dim0) is used by default (only in the C++ API; the dimension is
required to be specified in the C API):

\snippet test/scan.cpp ex_accum_2D

The output array type may be different from the input array type. The following
table defines the corresponding output types for each input type:

Input Type          | Output Type
--------------------|---------------------
f32, f64, c32, c64  | same as input
s32, u32, s64, u64  | same as input
s16                 | s32
u16, u8, b8         | u32

\copydoc batch_detail_algo



\defgroup scan_func_where where

\ingroup scan_mat

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.



\defgroup scan_func_scan scan

\ingroup scan_mat

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](\ref AF_BINARY_ADD), [mul](\ref AF_BINARY_MUL),
[min](\ref AF_BINARY_MIN), [max](\ref AF_BINARY_MAX) as defined by \ref af_binary_op.



\defgroup scan_func_scanbykey scanByKey

\ingroup scan_mat

Inclusive or exclusive scan of an array by key

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

Binary operations can be [add](\ref AF_BINARY_ADD), [mul](\ref AF_BINARY_MUL),
[min](\ref AF_BINARY_MIN), [max](\ref AF_BINARY_MAX) as defined by \ref af_binary_op.



\defgroup calc_func_diff1 diff1

\ingroup calc_mat

First order numerical difference along specified dimension

\copydoc batch_detail_algo



\defgroup calc_func_diff2 diff2

\ingroup calc_mat

Second order numerical difference along specified dimension

\copydoc batch_detail_algo



\defgroup sort_func_sort sort

\ingroup sort_mat

Sort input arrays

Sort an multi dimensional array



\defgroup sort_func_sort_index sortIndex

\ingroup sort_mat

Sort input arrays get the sorted indices

Sort a multi dimensional array and return sorted indices. Index array is of
type u32.



\defgroup sort_func_sort_keys sortByKey

\ingroup sort_mat

Sort input arrays based on keys

Sort a multi dimensional array based on keys



\defgroup set_func_unique setunique

\ingroup set_mat

Finds unique values from an input set. The input must be a one-dimensional array. Batching is not currently supported.

A simple example of finding the unique values of a set using setUnique() can be seen below:

\snippet test/set.cpp ex_set_unique_simple

The function can be sped up if it is known that the inputs are sorted.

\snippet test/set.cpp ex_set_unique_sorted

The inputs can be sorted in ascending or descending order.

\snippet test/set.cpp ex_set_unique_desc






\defgroup set_func_union setunion

\ingroup set_mat

Find the union of two sets. The inputs must be one-dimensional arrays. Batching is not currently supported.

A simple example of finding the union of two sets using setUnion() can be seen below:

\snippet test/set.cpp ex_set_union_simple

The function can be sped up if it is known that each input is sorted in increasing order and its values are unique.

\snippet test/set.cpp ex_set_union




\defgroup set_func_intersect setintersect

\ingroup set_mat

Find the intersection of two sets. The inputs must be one-dimensional arrays. Batching is not currently supported.

A simple example of finding the intersection of two sets using setIntersect() can be seen below:

\snippet test/set.cpp ex_set_intersect_simple

The function can be sped up if it is known that each input is sorted in increasing order and its values are unique.

\snippet test/set.cpp ex_set_intersect


@}
*/
