Back to Aurora Vision Library Lite website
You are here: Start » All Functions » Conditional Processing » SelectByRange
SelectByRange
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 |
Selects the elements of the input that fall into the specified range.
Syntax
void avl::SelectByRange ( const atl::Array<Type>& inArray, const atl::Array<float>& inValues, atl::Optional<float> inMinimum, atl::Optional<float> inMaximum, atl::Array<Type>& outSelected )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inArray | const Array<Type>& | Elements to be classified | ||
inValues | const Array<float>& | Corresponding values to be compared against the range | ||
inMinimum | Optional<float> | NIL | Lowest value of the range | |
inMaximum | Optional<float> | NIL | Highest value of the range | |
outSelected | Array<Type>& | Array of elements corresponding to values matching the range |
Description
The filter accepts an array of objects of type T (decided on filter creation) along with a corresponding array of float values. It selects the objects for which the associated values fit the (inMinimum, inMaximum) range.
Hints
- Also consider using the "select" function in formulas.
- Before using this filter you need to have an array of objects (to be classified) and an array of feature values that describe the objects.
- Connect the array of objects to the inArray input and connect the array of feature values to the inValues input.
- Set the range of inMinimum and inMaximum to define the accepted objects.
- If you also need to get the arrays of objects that were below or above the range, use the ClassifyByRange filter.
Examples
inArray = {"Alice", "Bill", "Frank", "Patricia", "Thomas"} inValues = {5.0, 4.0, 5.0, 8.0, 6.0} inMinimum = 5.0 inMaximum = 6.0 |
outSelected = {"Alice", "Frank", "Thomas"} |
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Inconsistent array lengths on input in SelectByRange. |
DomainError | Incorrect (NaN) float value on inValues input in SelectByRange. |
See Also
- ClassifyByRange – Separates the elements of the input array into three output arrays, depending on whether the related values fall below, into or above the specified range.
- SelectByPredicate – Selects the elements from the input array for which the associated predicate is True.