Skip to content

tuple_cumulTupleCumulTupleCumultuple_cumultuple_cumul🔗

Short description🔗

tuple_cumulTupleCumulTupleCumultuple_cumultuple_cumul — Calculate the cumulative sums of a tuple.

Signature🔗

tuple_cumul( number Tuple, out number Cumul )void TupleCumul( const HTuple& Tuple, HTuple* Cumul )static void HOperatorSet.TupleCumul( HTuple tuple, out 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]Herror tuple_cumul( const Hlong Tuple, double* Cumul )

Herror T_tuple_cumul( const Htuple Tuple, Htuple* Cumul )

HTuple HTuple::TupleCumul( ) const

HTuple HTuple.TupleCumul( )

Description🔗

tuple_cumulTupleCumul returns the different cumulative sums of the corresponding elements of the input tuple Tupletupletuple, i.e. the i-th element of the result tuple Cumulcumulcumul is the sum of the first i elements of the input tuple Tupletupletuple. For example, if Tupletupletuple contains the values [1,2,3,4], the output tuple Cumulcumulcumul will contain the values [1,3,6,10]. All elements of Tupletupletuple must be numbers (integer or floating point numbers). Each element of the result tuple Cumulcumulcumul 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 Cumulcumulcumul will also be an integer number.

Exception: Empty input tuple🔗

If the input tuple is empty, the operator returns an empty tuple.

HDevelop In-line Operation🔗

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

Cumul := cumul(Tuple)

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Tupletupletuple (input_control) number(-array) → (integer / real)HTuple (Hlong / double)HTuple (int / long / double)MaybeSequence[Union[float, int]]Htuple (Hlong / double)

Input tuple.

Cumulcumulcumul (output_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[float, int]]Htuple (double / Hlong)

Cumulative sum of the corresponding tuple elements.

Combinations with other operators🔗

Combinations

Alternatives

tuple_sumTupleSum

See also

tuple_min2TupleMin2, tuple_max2TupleMax2, tuple_addTupleAdd

Module🔗

Foundation