Cumulative sum.
Calculate the cumulative sum for all calling object elements in-place.
Example 1
var a: TVec;
begin
CreateIt(a);
try
a.SetIt(false,[1,2,3,4];
a.CumSum; // a = [1,3,6,10]
finally
FreeIt(a);
end;
end;
Declaration
Function CumSum(Vec: TVec): TVec;
Description
Calculate the cumulative sum for all Vec elements and store the results in calling object. Size and properties of the calling object are set implicitly.