You are here: Symbol Reference > MtxExpr Namespace > Classes > Vector Record > public > CumSum Method > Vector.CumSum Method (Integer, Integer)
MtxVec VCL
ContentsIndex
PreviousUpNext
Vector.CumSum Method (Integer, Integer)

Cumulative sum.

Pascal
function CumSum(Index: Integer; Len: Integer): TMtxVec; overload;

Calculate the cumulative sum for calling object elements [Index]..[Index+Len-1] in-place. An exception is raised if ConditionCheck is true and array borders are overrun.

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