Check vector values to compute average increment and check variations
int ocmath_sampling_resolution( UINT nSize, const double * pData, double * pMeanInc, double dTol = 0.05 )
OE_NOERROR if vector has consistent increment, orthewise, negetive error code is returned.
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); }
ocmath_mean_increment
origin.h