Back to FabImage Library website
You are here: Start » Function Reference » All Functions » Array Transforms » 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: | fil |
Module: | FoundationLite |
Changes the order of the input array elements according to an ascending/descending sequence of the value array.
Syntax
void fil::SortArray ( const ftl::Array<Type>& inArray, const ftl::Array<float>& inValues, fil::SortingOrder::Type inSortingOrder, ftl::Array<Type>& outSortedArray, ftl::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.