ClassesClassesClassesClasses | | | | Operators

tuple_intersectiontuple_intersectionTupleIntersectiontuple_intersectionTupleIntersectionTupleIntersection (Operator)

Name

tuple_intersectiontuple_intersectionTupleIntersectiontuple_intersectionTupleIntersectionTupleIntersection — Compute the intersection set of two input tuples.

Signature

tuple_intersection( : : Set1, Set2 : Intersection)

Herror tuple_intersection(const Hlong Set1, const Hlong Set2, Hlong* Intersection)

Herror T_tuple_intersection(const Htuple Set1, const Htuple Set2, Htuple* Intersection)

Herror tuple_intersection(const HTuple& Set1, const HTuple& Set2, Hlong* Intersection)

Herror tuple_intersection(const HTuple& Set1, const HTuple& Set2, HTuple* Intersection)

void TupleIntersection(const HTuple& Set1, const HTuple& Set2, HTuple* Intersection)

HTuple HTuple::TupleIntersection(const HTuple& Set2) const

void HOperatorSetX.TupleIntersection(
[in] VARIANT Set1, [in] VARIANT Set2, [out] VARIANT* Intersection)

VARIANT HTupleX.TupleIntersection(
[in] VARIANT Set1, [in] VARIANT Set2)

static void HOperatorSet.TupleIntersection(HTuple set1, HTuple set2, out HTuple intersection)

HTuple HTuple.TupleIntersection(HTuple set2)

Description

tuple_intersectiontuple_intersectionTupleIntersectiontuple_intersectionTupleIntersectionTupleIntersection returns the intersection set from Set1Set1Set1Set1Set1set1 and Set2Set2Set2Set2Set2set2 in IntersectionIntersectionIntersectionIntersectionIntersectionintersection. For example, if Set1Set1Set1Set1Set1set1 contains the values [0,1,3,3,5] and Set2Set2Set2Set2Set2set2 contains the values [2,3,5,10], the output IntersectionIntersectionIntersectionIntersectionIntersectionintersection is [3,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. Also, this means, if Set1Set1Set1Set1Set1set1 and Set2Set2Set2Set2Set2set2 have different types of elements, their intersection set could be empty. For example, if Set1Set1Set1Set1Set1set1 contains the values [2,5,3] and Set2Set2Set2Set2Set2set2 contains the values [2.0,5.0,0,10], the output IntersectionIntersectionIntersectionIntersectionIntersectionintersection is empty.

Exception: Empty input tuples

If either or both of the input tuples are empty, the operator returns an empty tuple.

HDevelop In-line Operation

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

Intersection := intersection(Set1, Set2)

Parallelization

Parameters

Set1Set1Set1Set1Set1set1 (input_control)  number(-array) HTupleHTupleHTupleVARIANTHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*) (Hlong / double / BSTR) (Hlong / double / char*)

Input tuple.

Set2Set2Set2Set2Set2set2 (input_control)  number(-array) HTupleHTupleHTupleVARIANTHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*) (Hlong / double / BSTR) (Hlong / double / char*)

Input tuple.

IntersectionIntersectionIntersectionIntersectionIntersectionintersection (output_control)  number(-array) HTupleHTupleHTupleVARIANTHtuple (integer / real / string) (int / long / double / string) (Hlong / double / HString) (Hlong / double / char*) (Hlong / double / BSTR) (Hlong / double / char*)

The intersection set of two input tuples.

Result

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

Alternatives

tuple_uniontuple_unionTupleUniontuple_unionTupleUnionTupleUnion

See also

tuple_differencetuple_differenceTupleDifferencetuple_differenceTupleDifferenceTupleDifference, tuple_symmdifftuple_symmdiffTupleSymmdifftuple_symmdiffTupleSymmdiffTupleSymmdiff, tuple_uniontuple_unionTupleUniontuple_unionTupleUnionTupleUnion

Module

Foundation


ClassesClassesClassesClasses | | | | Operators