tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectiontuple_intersection (算子名称)
名称
tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectiontuple_intersection — Compute the intersection set of two input tuples.
参数签名
def tuple_intersection(set_1: HTupleType, set_2: HTupleType) -> Sequence[HTupleElementType]
def tuple_intersection_s(set_1: HTupleType, set_2: HTupleType) -> HTupleElementType
描述
tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectionTupleIntersectiontuple_intersection returns the intersection set from
Set1Set1Set1Set1set1set_1 and Set2Set2Set2Set2set2set_2 in IntersectionIntersectionIntersectionIntersectionintersectionintersection. For example,
if Set1Set1Set1Set1set1set_1 contains the values [0,1,3,3,5] and Set2Set2Set2Set2set2set_2
contains the values [2,3,5,10], the output IntersectionIntersectionIntersectionIntersectionintersectionintersection is [3,5].
该算子 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
Set1Set1Set1Set1set1set_1 and Set2Set2Set2Set2set2set_2 have different types of elements, their
intersection set could be empty. For example, if Set1Set1Set1Set1set1set_1 contains
the values [2,5,3] and Set2Set2Set2Set2set2set_2 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, 该算子 returns an
empty tuple.
HDevelop In-line Operation
HDevelop provides an in-line operation for tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectionTupleIntersectiontuple_intersection,
which can be used in an expression in the following syntax:
Intersection := intersection(Set1, Set2)
运行信息
- Multithreading type: independent (runs in parallel even with exclusive operators).
- 多线程作用域:全局(可以从任何线程调用)。
- Automatically parallelized on internal data level.
参数表
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.
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)
The intersection set of two input tuples.
结果
如果参数均有效,算子
tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectionTupleIntersectiontuple_intersection 返回值 2 (
H_MSG_TRUE)
.
可替代算子
tuple_uniontuple_unionTupleUnionTupleUnionTupleUniontuple_union
参考其它
tuple_differencetuple_differenceTupleDifferenceTupleDifferenceTupleDifferencetuple_difference,
tuple_symmdifftuple_symmdiffTupleSymmdiffTupleSymmdiffTupleSymmdifftuple_symmdiff,
tuple_uniontuple_unionTupleUnionTupleUnionTupleUniontuple_union
模块
Foundation