A high-performance general-purpose compute library

Sort an array over a given dimension, according to an array of keys. More...

Functions

void sort (array &out_keys, array &out_values, const array &keys, const array &values, const unsigned dim=0, const bool isAscending=true)
 C++ Interface to sort an array over a given dimension, according to an array of keys.
 
af_err af_sort_by_key (af_array *out_keys, af_array *out_values, const af_array keys, const af_array values, const unsigned dim, const bool isAscending)
 C Interface to sort an array over a given dimension, according to an array of keys.
 

Detailed Description

Sort an array over a given dimension, according to an array of keys.

Function Documentation

◆ af_sort_by_key()

af_err af_sort_by_key ( af_array * out_keys,
af_array * out_values,
const af_array keys,
const af_array values,
const unsigned dim,
const bool isAscending )

C Interface to sort an array over a given dimension, according to an array of keys.

Parameters
[out]out_keyssorted keys
[out]out_valuessorted output
[in]keyskeys array
[in]valuesinput array
[in]dimdimension along which the sort occurs
[in]isAscendingspecifies the sorting order
Returns
AF_SUCCESS, if function returns successfully, else an af_err code is given

◆ sort()

void sort ( array & out_keys,
array & out_values,
const array & keys,
const array & values,
const unsigned dim = 0,
const bool isAscending = true )

C++ Interface to sort an array over a given dimension, according to an array of keys.

Parameters
[out]out_keyssorted keys
[out]out_valuessorted output
[in]keyskeys array
[in]valuesinput array
[in]dimdimension along which the sort occurs, 0 denotes the first non-singleton dimension
[in]isAscendingspecifies the sorting order