You are here: Symbol Reference > MtxExprInt Namespace > Classes > VectorInt Record > public > CumSum Method > VectorInt.CumSum Method ()
MtxVec VCL
ContentsIndex
PreviousUpNext
VectorInt.CumSum Method ()

Cumulative sum.

Pascal
function CumSum: TVecInt; overload;

Calculate the cumulative sum for all calling object elements in-place.

var a: TVecIn; begin CreateIt(a); try a.SetIt([1,2,3,4]); a.CumSum; // a = [1,3,6,10] finally FreeIt(a); end; end;
Examples on GitHub
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!