Skip to content

tuple_differenceTupleDifferenceTupleDifferencetuple_differencetuple_difference🔗

Short description🔗

tuple_differenceTupleDifferenceTupleDifferencetuple_differencetuple_difference — Compute the difference set of two input tuples.

Signature🔗

tuple_difference( tuple Set1, tuple Set2, out tuple Difference )void TupleDifference( const HTuple& Set1, const HTuple& Set2, HTuple* Difference )static void HOperatorSet.TupleDifference( HTuple set1, HTuple set2, out HTuple difference )def tuple_difference( set_1: HTupleType, set_2: HTupleType ) -> Sequence[HTupleElementType]

def tuple_difference_s( set_1: HTupleType, set_2: HTupleType ) -> HTupleElementTypeHerror tuple_difference( const Hlong Set1, const Hlong Set2, Hlong* Difference )

Herror T_tuple_difference( const Htuple Set1, const Htuple Set2, Htuple* Difference )

HTuple HTuple::TupleDifference( const HTuple& Set2 ) const

HTuple HTuple.TupleDifference( HTuple set2 )

Description🔗

tuple_differenceTupleDifference returns the difference set from Set1set1set_1 and Set2set2set_2 in Differencedifferencedifference. For example, if Set1set1set_1 contains the values [0,1,3,3,5] and Set2set2set_2 contains the values [2,3,5,10], the output Differencedifferencedifference is [0,1]. 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. Also, this means, if Set1set1set_1 and Set2set2set_2 have different types of elements, their difference set could be Set1set1set_1 itself. For example, if Set1set1set_1 contains the values [2,5,3] and Set2set2set_2 contains the values [2.0,5.0,3.0], the output Differencedifferencedifference is [2,3,5]. Please note that the order of tuple elements resulting from tuple_differenceTupleDifference does not necessarily conform to the order in the input tuple.

Exception: Empty input tuples🔗

If both input tuples are empty, the operator returns an empty tuple. If Set1set1set_1 is empty and Set2set2set_2 is not, the operator returns an empty tuple as well. If Set2set2set_2 is empty and Set1set1set_1 is not, the output corresponds to Set1set1set_1.

HDevelop In-line Operation🔗

HDevelop provides an in-line operation for tuple_differenceTupleDifference, which can be used in an expression in the following syntax:

Difference := difference(Set1, Set2)

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on internal data level.

Parameters🔗

Set1set1set_1 (input_control) tuple(-array) → (integer / real / string / handle)HTuple (Hlong / double / HString / HHandle)HTuple (int / long / double / string / HHandle)HTupleTypeHtuple (Hlong / double / char* / handle)

Input tuple.

Set2set2set_2 (input_control) tuple(-array) → (integer / real / string / handle)HTuple (Hlong / double / HString / HHandle)HTuple (int / long / double / string / HHandle)HTupleTypeHtuple (Hlong / double / char* / handle)

Input tuple.

Differencedifferencedifference (output_control) tuple(-array) → (integer / real / string / handle)HTuple (Hlong / double / HString / HHandle)HTuple (int / long / double / string / HHandle)Sequence[HTupleElementType]Htuple (Hlong / double / char* / handle)

The difference set of two input tuples.

Result🔗

If the parameters are valid, the operator tuple_differenceTupleDifference returns the value 2 (H_MSG_TRUE).

Combinations with other operators🔗

Combinations

Alternatives

tuple_symmdiffTupleSymmdiff

See also

tuple_intersectionTupleIntersection, tuple_symmdiffTupleSymmdiff, tuple_unionTupleUnion

Module🔗

Foundation