Back to Adaptive Vision Library website
You are here: Start » Function Reference » Array Transforms » SortArray
SortArray
This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.
Changes the order of the input array elements accordingly to an ascending/descending sequence of the value array.
Syntax
void avl::SortArray ( const atl::Array<Type>& inArray, const atl::Array<atl::real>& inValues, avl::SortingOrder::Type inSortingOrder, atl::Array<Type>& outSortedArray, atl::Array<atl::real>& outSortedValues )
Parameters
| Name | Type | Default | Description | |
|---|---|---|---|---|
![]() |
inArray | const Array<Type>& | Elements to be sorted | |
![]() |
inValues | const Array<real>& | Values defining the order | |
![]() |
inSortingOrder | SortingOrder::Type | Sorting order | |
![]() |
outSortedArray | Array<Type>& | Sorted elements | |
![]() |
outSortedValues | Array<real>& | Sorted values |
Examples
![]() |
![]() |
|
inArray = {"John","Alice","Bob","Karen"} inValues = {0.0,10.0,4.0,3.0} |
outSortedArray = {"John","Karen","Bob","Alice"} outSortedValues = {0.0,3.0,4.0,10.0} |
Errors
| Error type | Description |
|---|---|
| DomainError | Inconsistent array sizes in SortArray. |


