ClassesClasses | | Operators

tuple_cumultuple_cumulTupleCumulTupleCumul (Operator)


tuple_cumultuple_cumulTupleCumulTupleCumul — Calculate the cumulative sums of a tuple.


tuple_cumul( : : Tuple : Cumul)

Herror tuple_cumul(const Hlong Tuple, double* Cumul)

Herror T_tuple_cumul(const Htuple Tuple, Htuple* Cumul)

void TupleCumul(const HTuple& Tuple, HTuple* Cumul)

HTuple HTuple::TupleCumul() const

static void HOperatorSet.TupleCumul(HTuple tuple, out HTuple cumul)

HTuple HTuple.TupleCumul()


tuple_cumultuple_cumulTupleCumulTupleCumulTupleCumul returns the different cumulative sums of the corresponding elements of the input tuple TupleTupleTupleTupletuple, i.e. the i-th element of the result tuple CumulCumulCumulCumulcumul is the sum of the first i elements of the input tuple TupleTupleTupleTupletuple. For example, if TupleTupleTupleTupletuple contains the values [1,2,3,4], the output tuple CumulCumulCumulCumulcumul will contain the values [1,3,6,10]. All elements of TupleTupleTupleTupletuple must be numbers (integer or floating point numbers). Each element of the result tuple CumulCumulCumulCumulcumul 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 CumulCumulCumulCumulcumul 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_cumultuple_cumulTupleCumulTupleCumulTupleCumul, which can be used in an expression in the following syntax:

Cumul := cumul(Tuple)

Execution Information


TupleTupleTupleTupletuple (input_control)  number(-array) HTupleHTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Input tuple.

CumulCumulCumulCumulcumul (output_control)  number(-array) HTupleHTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Cumulative sum of the corresponding tuple elements.



See also

tuple_min2tuple_min2TupleMin2TupleMin2TupleMin2, tuple_max2tuple_max2TupleMax2TupleMax2TupleMax2, tuple_addtuple_addTupleAddTupleAddTupleAdd



ClassesClasses | | Operators