You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > TDenseMtxVec Class > TDenseMtxVec Methods > CumSum Method > TDenseMtxVec.CumSum Method (int, int)
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
TDenseMtxVec.CumSum Method (int, int)

Cumulative sum.

Syntax
C#
Visual Basic
public TMtxVec CumSum(int Index, int Len);

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

using Dew.Math; using Dew.Math.Units; namespace Dew.Examples() { void Example() { TVec a; MtxVec.CreateIt(out a); try { a.SetIt(true,new double[] {1,2,3,4}); a.CumSum(); // a = [1,3,6,10] } finally { MtxVec.FreeIt(ref a); } } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!