You are here: Start » All Functions » Array Set Operators » ArrayDifference
ArrayDifference
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 |
Returns an array of elements contained in the first input array, but not contained in the second one (without duplicates).
Syntax
void avl::ArrayDifference ( const atl::Array<Type>& inArray1, const atl::Array<Type>& inArray2, atl::Array<Type>& outArray )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
inArray1 | const Array<Type>& | First input array | ||
inArray2 | const Array<Type>& | Second input array | ||
outArray | Array<Type>& | Difference of the input arrays |
Description
The operation computes an array of elements contained in inArray1 but not in inArray2. The operation treats arrays as if those were sets, i.e., disregards the repeated elements in the input arrays and computes the result without repeating elements.
Examples
inArray1 = {1,1,1,2,2,3} inArray2 = {1,1,4} |
outArray = {2,3} |
Remarks
Please note, that this filter can be concretized only with basic data types and structures with implemented < operator. Order of elements may be different between AVL and Studio.
Using this filter to compare data of type Real (or structures with this type) may be tricky. It is caused by the fact that very small (unnoticeable) differences in values of such types may lead to unpredictable negative results in comparison of these values.
Errors
Non-comparable complex data type "TypeName" used in ArrayDifference.
See Also
- ArraySymmetricDifference – Returns an array of elements contained in odd number of the input arrays (without duplicates).