Back to FabImage Library website
You are here: Start » Function Reference » All Functions » Array Statistics » GetNthElement_OrNil
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 |
Returns the array element corresponding to the n-th biggest/smallest value from the inValues array; returns NIL if the arrays are empty.
Syntax
void fil::GetNthElement_OrNil ( const ftl::Array<Type>& inArray, const ftl::Array<float>& inValues, const int inN, fil::SortingOrder::Type inSortingOrder, typename ftl::ToConditionalType<Type>::Type& outElement, ftl::Conditional<float>& outValue, ftl::Conditional<int>& outIndex )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inArray | const Array<Type>& | Elements from which element corresponding to n-th value will be chosen | ||
![]() |
inValues | const Array<float>& | Values defining the order | ||
![]() |
inN | const int | 0 - ![]() |
||
![]() |
inSortingOrder | SortingOrder::Type | |||
![]() |
outElement | typename ToConditionalType<Type>::Type& | Element from the array | ||
![]() |
outValue | Conditional<float>& | Nth biggest/smallest value | ||
![]() |
outIndex | Conditional<int>& | Index of the found value |
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Inconsistent array sizes in GetNthElement_OrNil. |
DomainError | inN is negative in GetNthElement_OrNil. |