TAbstractMtxVecInt::CumSum Method

Overload List

#SignatureDescription
1TMtxVecInt *CumSum(int Index, int Len);Cumulative sum.
2TMtxVecInt *CumSum(TMtxVecInt *Vec, int VecIndex, int Index, int Len);Calculate the cumulative sum for Vec elements [VecIndex]..[VecIndex+Len-1].

Overload 1: TMtxVecInt *CumSum(int Index, int Len);

Cumulative sum.

#NameTypeDescription
1Indexint
2Lenint
Remarks:

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

Examples
#include "MtxVecInt.h"
#include "Units.MtxVecInt.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVecInt;

void Example()
{
    TVecInt* a;
    CreateIt(a);
    a->SetIt(DewArray<int>{1,2,3,4});
    a->CumSum();  // a = [1,3,6,10]
    FreeIt(a);
}
See Also: TAbstractMtxVecInt::Sum
Declared in Dew::Math::TMtxVecInt · Dew.Math/AbstractMtxVecInt.h · Cross-compiler

Overload 2: TMtxVecInt *CumSum(TMtxVecInt *Vec, int VecIndex, int Index, int Len);

Calculate the cumulative sum for Vec elements [VecIndex]..[VecIndex+Len-1].

#NameTypeDescription
1VecTMtxVecInt *
2VecIndexint
3Indexint
4Lenint
Remarks:

Store the results in calling object elements [Index]..[Index+Len-1]. Size and TAbstractMtxVecInt::IntPrecision properties of the calling object must be set explicitly. Exception is raised if TAbstractMtxVecInt::ConditionCheck property is True and array borders are overrun.

Declared in Dew::Math::TMtxVecInt · Dew.Math/AbstractMtxVecInt.h · Cross-compiler