Back to Aurora Vision Library Lite website
You are here: Start » All Functions » 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.
Header: | STD.h |
---|---|
Namespace: | avl |
Changes the order of the input array elements according to an ascending/descending sequence of the value array.
Syntax
void avl::SortArray ( const atl::Array<Type>& inArray, const atl::Array<float>& inValues, avl::SortingOrder::Type inSortingOrder, atl::Array<Type>& outSortedArray, atl::Array<float>& outSortedValues )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inArray | const Array<Type>& | Elements to be sorted | ||
inValues | const Array<float>& | Values defining the order | ||
inSortingOrder | SortingOrder::Type | Sorting order | ||
outSortedArray | Array<Type>& | Sorted elements | ||
outSortedValues | Array<float>& | 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
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Inconsistent array sizes in SortArray. |
See Also
- GetSortedElements – Returns elements corresponding to 8 smallest/biggest values from the array of values.