ClassesClasses | | Operators

tuple_differencetuple_differenceTupleDifferenceTupleDifference (Operator)

Name

tuple_differencetuple_differenceTupleDifferenceTupleDifference — Compute the difference set of two input tuples.

Signature

tuple_difference( : : Set1, Set2 : Difference)

Herror tuple_difference(const Hlong Set1, const Hlong Set2, Hlong* Difference)

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

void TupleDifference(const HTuple& Set1, const HTuple& Set2, HTuple* Difference)

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

static void HOperatorSet.TupleDifference(HTuple set1, HTuple set2, out HTuple difference)

HTuple HTuple.TupleDifference(HTuple set2)

Description

tuple_differencetuple_differenceTupleDifferenceTupleDifferenceTupleDifference returns the difference set from Set1Set1Set1Set1set1 and Set2Set2Set2Set2set2 in DifferenceDifferenceDifferenceDifferencedifference. For example, if Set1Set1Set1Set1set1 contains the values [0,1,3,3,5] and Set2Set2Set2Set2set2 contains the values [2,3,5,10], the output DifferenceDifferenceDifferenceDifferencedifference 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 Set1Set1Set1Set1set1 and Set2Set2Set2Set2set2 have different types of elements, their difference set could be Set1Set1Set1Set1set1 itself. For example, if Set1Set1Set1Set1set1 contains the values [2,5,3] and Set2Set2Set2Set2set2 contains the values [2.0,5.0,3.0], the output DifferenceDifferenceDifferenceDifferencedifference is [2,5,3].

Exception: Empty input tuples

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

HDevelop In-line Operation

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

Difference := difference(Set1, Set2)

Execution Information

Parameters

Set1Set1Set1Set1set1 (input_control)  number(-array) HTupleHTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Input tuple.

Set2Set2Set2Set2set2 (input_control)  number(-array) HTupleHTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

Input tuple.

DifferenceDifferenceDifferenceDifferencedifference (output_control)  number(-array) HTupleHTupleHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*)

The difference set of two input tuples.

Result

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

Alternatives

tuple_symmdifftuple_symmdiffTupleSymmdiffTupleSymmdiffTupleSymmdiff

See also

tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectionTupleIntersection, tuple_symmdifftuple_symmdiffTupleSymmdiffTupleSymmdiffTupleSymmdiff, tuple_uniontuple_unionTupleUnionTupleUnionTupleUnion

Module

Foundation


ClassesClasses | | Operators