2.1.22.2.3 ocmath_sampling_resolution


Description

Check vector values to compute average increment and check variations

Syntax

int ocmath_sampling_resolution( UINT nSize, const double * pData, double * pMeanInc, double dTol = 0.05 )

Parameters

nSize
[input] size of input vector.
pData
[input] pointer to vector's data
pMeanInc
[output] The average differences between each succesive values in the vector
dTol
[input] tolerance parameter in fraction of allowed variations in these increments. A value of 0.05 will allow a 5% variations

Return

OE_NOERROR if vector has consistent increment, orthewise, negetive error code is returned.

Examples

EX1

void ocmath_check_increment()
{ 
    vector vX = {0.1, 0.4, 0.7, 1, 1.3, 1.6003};
    double dInterval;
    int nErr;
    if((nErr = ocmath_sampling_resolution(vX.GetSize(), vX, &dInterval))!= OE_NOERROR)
        out_int("err = ", nErr);
    else
        out_double("increment = ", dInterval);
}

Remark

See Also

ocmath_mean_increment

Header to Include

origin.h

Reference