Devides the array to multiple parts and get each part's mean increment, standard deviations.
int ocmath_mean_increment( UINT nSize, const double * pData, double * pMeanInc, int nSegments = 1, double * pSD = NULL, int * pSegSize = NULL, UINT nPts = 0 )
Return OE_NOERROR if succeed, otherwise, non-zero error code is returned.
EX1
void ocmath_mean_increment_ex1() { vector vTest = {0.1, 0.3, 0.5, 0.55, 0.6, 1.1, 1.9}; double dMeanInc; int nRet = ocmath_mean_increment(vTest.GetSize(), vTest, &dMeanInc, 1); } // At the end of example: dMeanInc = 0.3;
EX2
void ocmath_mean_increment_ex2() { vector vTest = {0.1, 0.3, 0.5, 0.55, 0.6, 1.1, 1.9}; int nSegments = 2; vector vMeanInc(nSegments); vector<int> vSegSize(nSegments); int nRet = ocmath_mean_increment(vTest.GetSize(), vTest, vMeanInc, nSegments, NULL, vSegSize); } // At the end of example: vMeanInc = {0.2, 0.45}; vSegSize = {3, 4}; // vTest will be divided to two parts:{0.1, 0.3, 0.5} and {0.55, 0.6, 1.1 ,1.9}
This function devides array to nSegments parts and get each part's mean increment,
standard deviations (SD) of each part's increment array if pSD != NULL and each
part's elements number if pSegSize != NULL.
if nPts = 0, use all the data as specified by nSize, if nPts > 0, use
MIN(nSize, nPts) for the calculation.
nSegments can equal to 1, that is to say compute whole array's mean increment,
SD of increment array and SegSize.
origin.h