tuple_cumultuple_cumulTupleCumulTupleCumultuple_cumul (算子)
名称
tuple_cumultuple_cumulTupleCumulTupleCumultuple_cumul — 计算元组的累积和。
签名
Herror tuple_cumul(const Hlong Tuple, double* Cumul)
Herror T_tuple_cumul(const Htuple Tuple, Htuple* Cumul)
def tuple_cumul(tuple: MaybeSequence[Union[float, int]]) -> Sequence[Union[float, int]]
def tuple_cumul_s(tuple: MaybeSequence[Union[float, int]]) -> Union[float, int]
描述
tuple_cumultuple_cumulTupleCumulTupleCumulTupleCumultuple_cumul returns the different cumulative sums of the
corresponding elements of the input tuple TupleTupleTupleTupletupletuple, i.e. the i-th
element of the result tuple CumulCumulCumulCumulcumulcumul is the sum of the first i
elements of the input tuple TupleTupleTupleTupletupletuple. For example, if
TupleTupleTupleTupletupletuple contains the values [1,2,3,4], the output tuple
CumulCumulCumulCumulcumulcumul will contain the values [1,3,6,10].
All elements of TupleTupleTupleTupletupletuple
must be numbers (integer or floating point numbers). Each element
of the result tuple CumulCumulCumulCumulcumulcumul will contain a floating point number if
at least one element of the calculation is a floating point number.
If all elements of the calculation are integer numbers the resulting
sum in CumulCumulCumulCumulcumulcumul will also be an integer number.
例外:空输入元组
If the input tuple is empty, the operator returns an empty tuple.
HDevelop 内联操作
HDevelop provides an in-line operation for tuple_cumultuple_cumulTupleCumulTupleCumulTupleCumultuple_cumul,
which can be used in an expression in the following syntax:
Cumul := cumul(Tuple)
执行信息
- 多线程类型:独立(即使使用独占算子也能并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
TupleTupleTupleTupletupletuple (输入控制) number(-array) → HTupleMaybeSequence[Union[float, int]]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)
Input tuple.
CumulCumulCumulCumulcumulcumul (输出控制) number(-array) → HTupleSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Cumulative sum of the corresponding tuple elements.
替代
tuple_sumtuple_sumTupleSumTupleSumTupleSumtuple_sum
另见
tuple_min2tuple_min2TupleMin2TupleMin2TupleMin2tuple_min2,
tuple_max2tuple_max2TupleMax2TupleMax2TupleMax2tuple_max2,
tuple_addtuple_addTupleAddTupleAddTupleAddtuple_add
模块
基础