Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » Array Statistics » GetNthElement

GetNthElement


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
Module: FoundationLite

Returns the array element corresponding to the n-th biggest/smallest value from the inValues array.

Syntax

void avl::GetNthElement
(
	const atl::Array<Type>& inArray,
	const atl::Array<float>& inValues,
	const int inN,
	avl::SortingOrder::Type inSortingOrder,
	Type& outElement,
	float& outValue,
	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 Type& Element from the array
Output value outValue float& Nth biggest/smallest value
Output value outIndex int& Index of the found value

Hints

  • You must guarantee that the input arrays have at least N+1 elements.

Errors

List of possible exceptions:

Error type Description
DomainError Empty input array in GetNthElement.
DomainError Inconsistent array sizes in GetNthElement.
DomainError inN is negative or exceeds the input arrays size in GetNthElement.

See Also

  • GetMinimumElement – Returns an array element that corresponds to the smallest value in the array of values.
  • GetMaximumElement – Returns an array element that corresponds to the biggest value in the array of values.