Back to Aurora Vision Library website

You are here: Start » Function Reference » All Functions » Array Set Operators » ArrayUnion

ArrayUnion


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

Returns an array of elements contained in at least one of the input arrays (without duplicates).

Syntax

void avl::ArrayUnion
(
	const atl::Array<Type>& inArray1,
	const atl::Array<Type>& inArray2,
	const atl::Optional<atl::Array<Type>& > inArray3,
	const atl::Optional<atl::Array<Type>& > inArray4,
	bool inSort,
	atl::Array<Type>& outArray
)

Parameters

Name Type Default Description
Input value inArray1 const Array<Type>& First input array
Input value inArray2 const Array<Type>& Second input array
Input value inArray3 const Optional<Array<Type>& > NIL Third input array (optional)
Input value inArray4 const Optional<Array<Type>& > NIL Fourth input array (optional)
Input value inSort bool True
Output value outArray Array<Type>& Union of the input arrays

Description

The operation computes an array of elements contained in at least one of the input arrays. 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 = {1,2,3,4}

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 ArrayUnion.

See Also

  • ArrayIntersection – Returns an array of elements contained in all of the input arrays (without duplicates).