Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » Conditional Processing » ClassifyByCase

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

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
Input value inArray const Array<Type>& Elements to be classified
Input value inCaseIndices const Array<int>& Reference values corresponding to the input array elements
Output value outCase0 Array<Type>& Elements corresponding to the case 0
Output value outCase1 Array<Type>& Elements corresponding to the case 1
Output value outCase2 Array<Type>& Elements corresponding to the case 2
Output value outCase3 Array<Type>& Elements corresponding to the case 3
Output value outCase4 Array<Type>& Elements corresponding to the case 4
Output value outCase5 Array<Type>& Elements corresponding to the case 5
Output value outCase6 Array<Type>& Elements corresponding to the case 6
Output value 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.