2.1.24.4.49 ocmath_us_minmax_in_range


Description

Find indices to min/max values that fall withing given value range and also to return the number of missing values.

Syntax

uint ocmath_us_minmax_in_range( const USHORT * pData, int nCount, double dRangeMin, double dRangeMax, const USHORT * pMissing, uint * pnmin = NULL, uint * pnmax = NULL )

Parameters

pData
[input] pointer to vector data,
nCount
[input] number of elements in pData
dRangeMin
[input] min range value
dRangeMax
[input] max range value
pMissing
[input] Think as missing value, can be NULL if no missing values are defined
pnmin
[output] index to the found min value location
pnmax
[output] index to the found max value location

Return

number of missing values.

Examples

EX1

void    ocmath_us_minmax_Ex1()
{
    vector v = {1,2,3,4,5,2,3,4,54,3,3,4,3,3};
    v[7]=-1.23e-123;
    
    uint     nMin,nMax;
    double     dNam =-1.23e-123;
    uint     nMissingValues = ocmath_d_minmax_in_range(v, v.GetSize(), 3., 8., &dNam, &nMin, &nMax);
    printf("%d %d %d\n", nMissingValues, nMin, nMax);
    //nMissingValues=1    nMin=2 nMax=4             
}

Remark

Find indices to min/max values that fall withing given value range and also to return the number of missing values

Data types supported:

double: ocmath_d_minmax_in_range
float: ocmath_f_minmax_in_range
int: ocmath_i_minmax_in_range
unsigned short: ocmath_us_minmax_in_range
unsigned char: ocmath_b_minmax_in_range

See Also

ocmath_f_minmax_in_range, ocmath_i_minmax_in_range, ocmath_b_minmax_in_range

Header to Include

origin.h

Reference