Back to Aurora Vision Library Lite website

You are here: Start » All Functions » Array Statistics » GetNthElement_OrNil

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: avl

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 avl::GetNthElement_OrNil
(
	const atl::Array<Type>& inArray,
	const atl::Array<float>& inValues,
	const int inN,
	avl::SortingOrder::Type inSortingOrder,
	typename atl::ToConditionalType<Type>::Type& outElement,
	atl::Conditional<float>& outValue,
	atl::Conditional<int>& outIndex
)

Parameters

Name Type Range Default Description
Input value inArray const Array<Type>& Elements from which element corresponding to n-th value will be chosen
Input value inValues const Array<float>& Values defining the order
Input value inN const int 0 -
Input value inSortingOrder SortingOrder::Type
Output value outElement typename ToConditionalType<Type>::Type& Element from the array
Output value outValue Conditional<float>& Nth biggest/smallest value
Output 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.