tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectiontuple_intersection (Operator)

Name

tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectiontuple_intersection — Berechnet die Schnittmenge von zwei Tupeln.

Signatur

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)

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

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

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

HTuple HTuple.TupleIntersection(HTuple set2)

def tuple_intersection(set_1: HTupleType, set_2: HTupleType) -> Sequence[HTupleElementType]

def tuple_intersection_s(set_1: HTupleType, set_2: HTupleType) -> HTupleElementType

Beschreibung

tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectionTupleIntersectiontuple_intersection liefert die Schnittmenge von Set1Set1Set1Set1set1set_1 und Set2Set2Set2Set2set2set_2 in IntersectionIntersectionIntersectionIntersectionintersectionintersection zurück. Der Schnitt von [0,1,3,3,5] und [2,3,5,10] ist zum Beispiel [3,5]. Elemente unterschiedlichen Typs werden als unterschiedliche Elemente betrachtet, das heißt, 1.0 und 1 sind nicht gleich. Wenn Set1Set1Set1Set1set1set_1 und Set2Set2Set2Set2set2set_2 unterschiedliche Elementtypen enthalten, kann ihre Schnittmenge leer sein. So ist zum Beispiel der Schnitt von [2.0,5.0,0,10] und [2,5,3] leer. Es ist zu beachten, dass die Reihenfolge der Elemente im Ergebnistupel von tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectionTupleIntersectiontuple_intersection nicht zwingend der Reihenfolge im Eingabetupel entspricht.

Sonderfall: Leere Eingabetupel

Falls eines oder beide der Eingabetupel leer sind, gibt der Operator ein leeres Tupel zurück.

HDevelop Inline-Operation

HDevelop unterstützt eine Inline-Operation für tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectionTupleIntersectiontuple_intersection, die innerhalb eines Ausdrucks in der folgenden Syntax verwendet werden kann:

Intersection := intersection(Set1, Set2)

Ausführungsinformationen

Parameter

Set1Set1Set1Set1set1set_1 (input_control)  tuple(-array) HTupleHTupleTypeHTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)

Eingabe-Tupel.

Set2Set2Set2Set2set2set_2 (input_control)  tuple(-array) HTupleHTupleTypeHTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)

Eingabe-Tupel.

IntersectionIntersectionIntersectionIntersectionintersectionintersection (output_control)  tuple(-array) HTupleSequence[HTupleElementType]HTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)

Die Schnittmenge aus den zwei Eingabe-Tupeln.

Ergebnis

Sind die Parameterwerte korrekt, dann liefert tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectionTupleIntersectiontuple_intersection den Wert 2 (H_MSG_TRUE).

Alternativen

tuple_uniontuple_unionTupleUnionTupleUnionTupleUniontuple_union

Siehe auch

tuple_differencetuple_differenceTupleDifferenceTupleDifferenceTupleDifferencetuple_difference, tuple_symmdifftuple_symmdiffTupleSymmdiffTupleSymmdiffTupleSymmdifftuple_symmdiff, tuple_uniontuple_unionTupleUnionTupleUnionTupleUniontuple_union

Modul

Foundation