Back to FabImage Library website

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

GetMinimumElement_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 an array element that corresponds to the smallest value in the array of values; returns NIL if the arrays are empty.

Applications: Choosing one object from an array on the basis of some feature, e.g. the blob having the smallest convexity.

Syntax

void fil::GetMinimumElement_OrNil
(
	const ftl::Array<Type>& inArray,
	const ftl::Array<float>& inValues,
	typename ftl::ToConditionalType<Type>::Type& outElement,
	ftl::Conditional<float>& outValue,
	ftl::Conditional<int>& outIndex
)

Parameters

Name Type Default Description
Input value
inArray const Array<Type>& Elements from which element corresponding to smallest value will be chosen
Input value
inValues const Array<float>& Values defining the order
Output value
outElement typename ToConditionalType<Type>::Type& Element from the array
Output value
outValue Conditional<float>& Smallest value
Output value
outIndex Conditional<int>& Index of the smallest value

Errors

List of possible exceptions:

Error type Description
DomainError Inconsistent array sizes in GetMinimumElement_OrNil.