Back to FabImage Library website
You are here: Start » Function Reference » All Functions » Conditional Processing » ClassifyByCase
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 |
Separates the elements of the input array into several output arrays, depending on the associated array of case indices.
Syntax
void fil::ClassifyByCase ( const ftl::Array<Type>& inArray, const ftl::Array<int>& inCaseIndices, ftl::Array<Type>& outCase0, ftl::Array<Type>& outCase1, ftl::Array<Type>& outCase2, ftl::Array<Type>& outCase3, ftl::Array<Type>& outCase4, ftl::Array<Type>& outCase5, ftl::Array<Type>& outCase6, ftl::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 |
Hints
- Also consider using the "select" function in formulas.
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
List of possible exceptions:
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 the 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.