Vector.CumSum Method

Overload List

#SignatureDescription
1TVec CumSumCumulative sum.
└ indexed: TMtxVec CumSum(Int32 Index, Int32 Len)
2TVec CumSum(TVec Vec)Calculate the cumulative sum for all Vec elements.
3TMtxVec CumSum(TMtxVec Vec, Int32 VecIndex, Int32 Index, Int32 Len)Calculate the cumulative sum for Vec elements [VecIndex]..[VecIndex+Len-1] and store the results in calling object elements [Index]..[Index+Len-1].

Overload 1: TVec CumSum

Cumulative sum.

Result: stored in self (calling object), returns self for chaining

Remarks:

Calculate the cumulative sum for all calling object elements in-place.

Examples
Vector a;
a.SetIt(false,new double[] {1,2,3,4};
a.CumSum; // a = new double[] {1,3,6,10}
See Also: Vector.Sum

Indexed: TMtxVec CumSum(Int32 Index, Int32 Len)

Cumulative sum.

#NameTypeDescription
1IndexInt32start index
2LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

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

Examples
Vector a;
a.SetIt(false,new double[] {1,2,3,4};
a.CumSum; // a = new double[] {1,3,6,10}
See Also: Vector.Sum

Overload 2: TVec CumSum(TVec Vec)

Calculate the cumulative sum for all Vec elements.

#NameTypeDescription
1VecTVecsource TVec

Result: stored in self (calling object), returns self for chaining

Remarks:

Store the results in calling object. Size and Dew.Math.Vector.Complex properties of the calling object are set implicitly.

Overload 3: TMtxVec CumSum(TMtxVec Vec, Int32 VecIndex, Int32 Index, Int32 Len)

Calculate the cumulative sum for Vec elements [VecIndex]..[VecIndex+Len-1] and store the results in calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2VecIndexInt32
3IndexInt32start index
4LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

Size and Dew.Math.Vector.Complex properties of the calling object must be set explicitly. Exception is raised if Dew.Math.Vector.ConditionCheck property is True and array borders are overrun.