tuple_symmdifftuple_symmdiffTupleSymmdiffTupleSymmdifftuple_symmdiff(算子)
名称
tuple_symmdifftuple_symmdiffTupleSymmdiffTupleSymmdifftuple_symmdiff — 计算两个输入元组的对称差集。
签名
def tuple_symmdiff(set_1: HTupleType, set_2: HTupleType) -> Sequence[HTupleElementType]
def tuple_symmdiff_s(set_1: HTupleType, set_2: HTupleType) -> HTupleElementType
描述
tuple_symmdifftuple_symmdiffTupleSymmdiffTupleSymmdiffTupleSymmdifftuple_symmdiff returns the symmetric difference set from
Set1Set1Set1Set1set1set_1 and Set2Set2Set2Set2set2set_2 in SymmDiffSymmDiffSymmDiffSymmDiffsymmDiffsymm_diff. 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 SymmDiffSymmDiffSymmDiffSymmDiffsymmDiffsymm_diff is [0,1,2,10].
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
Set1Set1Set1Set1set1set_1 and Set2Set2Set2Set2set2set_2 have different types of elements, their
symmetric difference set could be the union. For example, if Set1Set1Set1Set1set1set_1
contains the values [2,5,3] and Set2Set2Set2Set2set2set_2 contains the values [2.0,5.0],
the output SymmDiffSymmDiffSymmDiffSymmDiffsymmDiffsymm_diff is [2,5,3,2.0,5.0].
例外:空输入元组
If both of the input tuples are empty, the operator returns an
empty tuple. If one of the input tuples is empty and the other is not,
the output corresponds to the input tuple that is not empty.
HDevelop 内联操作
HDevelop provides an in-line operation for tuple_symmdifftuple_symmdiffTupleSymmdiffTupleSymmdiffTupleSymmdifftuple_symmdiff,
which can be used in an expression in the following syntax:
SymmDiff := symmdiff(Set1, Set2)
执行信息
- 多线程类型:独立(即使使用独占算子也能并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 在内部数据级别上自动并行化。
参数
Set1Set1Set1Set1set1set_1 (输入控制) tuple(-array) → HTupleHTupleTypeHTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)
Input tuple.
Set2Set2Set2Set2set2set_2 (输入控制) tuple(-array) → HTupleHTupleTypeHTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)
Input tuple.
SymmDiffSymmDiffSymmDiffSymmDiffsymmDiffsymm_diff (输出控制) tuple(-array) → HTupleSequence[HTupleElementType]HTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)
The symmetric difference set of two input tuples.
结果
如果参数有效,算子
tuple_symmdifftuple_symmdiffTupleSymmdiffTupleSymmdiffTupleSymmdifftuple_symmdiff 返回值 2 ( H_MSG_TRUE )。
替代
tuple_differencetuple_differenceTupleDifferenceTupleDifferenceTupleDifferencetuple_difference
另见
tuple_differencetuple_differenceTupleDifferenceTupleDifferenceTupleDifferencetuple_difference,
tuple_intersectiontuple_intersectionTupleIntersectionTupleIntersectionTupleIntersectiontuple_intersection,
tuple_uniontuple_unionTupleUnionTupleUnionTupleUniontuple_union
模块
基础