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

Cumulative sum.

Syntax
C#
Visual Basic
public TMtxVecInt 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() { TVecInt a; MtxVecInt.CreateIt(out a); try { a.SetIt(true,new double[] {1,2,3,4}); a.CumSum(); // a = [1,3,6,10] } finally { MtxVecInt.FreeIt(ref a); } } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!