You are here: Symbol Reference > MtxExpr Namespace > Classes > Matrix Record > public > CumSum Method > Matrix.CumSum Method (Integer, Integer)
MtxVec VCL
ContentsIndex
PreviousUpNext
Matrix.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: Matrix; begin a.SetIt(2,2,false,[1,2,3,4]; a.CumSum(0,4); // 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!