Sort input arrays based on keys. More...

Functions

AFAPI void sort (array &out_keys, array &out_values, const array &keys, const array &values, const unsigned dim=0, const bool isAscending=true)
 C++ Interface for sorting an array based on keys. More...
 
AFAPI 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 for sorting an array based on keys. More...
 

Detailed Description

Sort input arrays based on keys.

Sort a multi dimensional array based on keys

Function Documentation

◆ af_sort_by_key()

AFAPI 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 for sorting an array based on keys.

Parameters
[out]out_keyswill contain the keys based on sorted values
[out]out_valueswill contain the sorted values
[in]keysis the input array
[in]valuesThe dimension along which numerical difference is performed
[in]dimThe dimension along which numerical difference is performed
[in]isAscendingspecifies the sorting order
Returns
AF_SUCCESS if the execution completes properly

◆ sort()

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

C++ Interface for sorting an array based on keys.

Parameters
[out]out_keyswill contain the keys based on sorted values
[out]out_valueswill contain the sorted values
[in]keysis the input array
[in]valuesThe dimension along which numerical difference is performed
[in]dimThe dimension along which numerical difference is performed
[in]isAscendingspecifies the sorting order