Calculate the cumulative sum of the data.
uint ocmath_us_cumulative_sum( const USHORT * pData, uint i1, uint i2, USHORT * pCumSum, const USHORT * pMissing = NULL )
number of missing value
EX1
void ocmath_us_cumulative_sum_ex1() { vector<ushort> vecData = {1,2,3,4,5,6,7,9,10,0}; uint i1 = 0; uint i2 = vecData.GetSize(); vector<ushort> vecCumSum; vecCumSum.SetSize(i2-i1); uint numMissing = ocmath_us_cumulative_sum(vecData,i1,i2,vecCumSum); printf("%d", numMissing); }
Calculate the cumulative sum data of pData from i1 to i2-1,
and record every step's result in pCumSum.
Data type is ushort. pCumSum[0] = pData[0],
If pData[ii] = pMissing, pSumCum[ii] = pSumCum[ii-1],
else pSumCum[ii] = pSumCum[ii-1]+pData[ii].
Data types supported:
ocmath_d_cumulative_sum, ocmath_f_cumulative_sum, ocmath_i_cumulative_sum, ocmath_b_cumulative_sum
origin.h