tuple_uniontuple_unionTupleUnionTupleUniontuple_union (Operator)
Name
tuple_uniontuple_unionTupleUnionTupleUniontuple_union
— Compute the union set of two input tuples.
Signature
Herror tuple_union(const Hlong Set1, const Hlong Set2, Hlong* Union)
Herror T_tuple_union(const Htuple Set1, const Htuple Set2, Htuple* Union)
def tuple_union(set_1: HTupleType, set_2: HTupleType) -> Sequence[HTupleElementType]
def tuple_union_s(set_1: HTupleType, set_2: HTupleType) -> HTupleElementType
Description
tuple_uniontuple_unionTupleUnionTupleUnionTupleUniontuple_union
returns the union set from
Set1Set1Set1Set1set1set_1
and Set2Set2Set2Set2set2set_2
in UnionUnionUnionUnionunionunion
. For example,
if Set1Set1Set1Set1set1set_1
contains the values [0,1,3,3,5] and Set2Set2Set2Set2set2set_2
contains the values [3,4], the output UnionUnionUnionUnionunionunion
is [0,1,3,4,5].
The operator also allows mixed types of elements in the input tuples.
However, the elements with different types will be considered as
different elements, i.e. 1.0 and 1 are different. For example,
the union of [2,5,3] and [4.0,5.0] is [2,5,3,4.0,5.0].
Exception: Empty input tuples
If both of the input tuples are empty, the operator returns an
empty tuple. If one of the input tuples is empty and the other is not,
the output corresponds to the input tuple that is not empty.
HDevelop In-line Operation
HDevelop provides an in-line operation for tuple_uniontuple_unionTupleUnionTupleUnionTupleUniontuple_union
,
which can be used in an expression in the following syntax:
Union := union(Set1, Set2)
Execution Information
- Multithreading type: independent (runs in parallel even with exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on internal data level.
Parameters
Set1Set1Set1Set1set1set_1
(input_control) tuple(-array) →
HTupleHTupleTypeHTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)
Input tuple.
Set2Set2Set2Set2set2set_2
(input_control) tuple(-array) →
HTupleHTupleTypeHTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)
Input tuple.
UnionUnionUnionUnionunionunion
(output_control) tuple(-array) →
HTupleSequence[HTupleElementType]HTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)
The union set of two input tuples.
Result
If the parameters are valid, the operator
tuple_uniontuple_unionTupleUnionTupleUnionTupleUniontuple_union
returns the value TRUE.
Alternatives
tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectionTupleIntersectiontuple_intersection
See also
tuple_differencetuple_differenceTupleDifferenceTupleDifferenceTupleDifferencetuple_difference
,
tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectionTupleIntersectiontuple_intersection
,
tuple_symmdifftuple_symmdiffTupleSymmdiffTupleSymmdiffTupleSymmdifftuple_symmdiff
Module
Foundation