Back to Adaptive Vision Library website
You are here: Start » Function Reference » Conditional Processing » ClassifyByCase
This is Filter Equivalent. This function may be present in generated code, but should not be used in hand-written code.
Separates the elements of the input array into several output arrays, depending on the associated array of case indices.
Syntax
void avl::ClassifyByCase ( const atl::Array<Type>& inArray, const atl::Array<int>& inCaseIndices, atl::Array<Type>& outCase0, atl::Array<Type>& outCase1, atl::Array<Type>& outCase2, atl::Array<Type>& outCase3, atl::Array<Type>& outCase4, atl::Array<Type>& outCase5, atl::Array<Type>& outCase6, atl::Array<Type>& outCase7 )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inArray | const Array<Type>& | Elements to be classified | ||
inCaseIndices | const Array<int>& | Reference values corresponding to the input array elements | ||
outCase0 | Array<Type>& | Elements corresponding to the case 0 | ||
outCase1 | Array<Type>& | Elements corresponding to the case 1 | ||
outCase2 | Array<Type>& | Elements corresponding to the case 2 | ||
outCase3 | Array<Type>& | Elements corresponding to the case 3 | ||
outCase4 | Array<Type>& | Elements corresponding to the case 4 | ||
outCase5 | Array<Type>& | Elements corresponding to the case 5 | ||
outCase6 | Array<Type>& | Elements corresponding to the case 6 | ||
outCase7 | Array<Type>& | Elements corresponding to the case 7 |
Examples
inArray = {"Alice", "Bill", "Frank", "Patricia", "Thomas"} inCaseIndices = {0, 7, 1, 1, 1} |
outCase0 = {"Alice"} outCase1 = {"Frank", "Patricia", "Thomas"} outCase2 = {} outCase3 = {} outCase4 = {} outCase5 = {} outCase6 = {} outCase7 = {"Bill"} |
Errors
Error type | Description |
---|---|
DomainError | Inconsistent array lengths on input in ClassifyByCase. |
DomainError | Incorrect case index in ClassifyByCase. |
See Also
- ClassifyByPredicate – Separates the elements of the input array into two output arrays. The first output array contains all elements for which the associated predicate is True.
- 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.