You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > MatrixInt Structure > MatrixInt Methods > CumSum Method > MatrixInt.CumSum Method ()
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
MatrixInt.CumSum Method ()

Cumulative sum for each of the matrix columns.

Syntax
C#
Visual Basic
public TMtxInt CumSum();

Calculate the cumulative sum for each of the calling matrix columns in-place. Function performs no overflow checking. It is users responsibility to ensure that the sum does not overflow the range of the used integer storage type.

var Mtx: TMtxInt; begin Mtx := TMtxInt.Create; try Mtx.Size(3,2,[1,2, 2,5, 3,1]); Mtx.CumSum; // Mtx becomes: // 1, 2 // 3, 7 // 6, 8 finally Mtx.Free; end; end;
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!