2.1.24.4.21 ocmath_d_minmax


Description

Find indices to min/max values and also to return the number of missing values in the given range.

Syntax

uint ocmath_d_minmax( const double * pData, uint i1, uint i2, uint * pnmin = NULL, uint * pnmax = NULL )

Parameters

pData
[input] pointer to vector data,
i1
[input] starting index to search for min max
i2
[input] ending index (inclusive) to search min max
pnmin
[output] index to the found min value location
pnmax
[output] index to the found max value location

Return

number of missing values. If all values in range are missing values, then return (i2-i1+1). If none are missing values then returns 0

Examples

EX1

void    ocmath_d_minmax_Ex1()
{
    double     v[]={1,2,3,4,5,2,3,4,54,3,3,4,3,3};
    v[7]=NANUM;
    
    uint     nMin,nMax;
    uint     nMissingValues = ocmath_d_minmax(v, 2, 14, &nMin, &nMax);
    printf("%d %d %d\n", nMissingValues, nMin, nMax);
    //nMissingValues=1    nMin=14 nMax=8             
}

Remark

Find indices to min/max values and also to return the number of missing values in the given range Data types supported:

double: ocmath_d_minmax
float: ocmath_f_minmax
int: ocmath_i_minmax
unsigned short: ocmath_us_minmax
unsigned char: ocmath_b_minmax
complex: ocmath_z_minmax

See Also

ocmath_f_minmax, ocmath_i_minmax, ocmath_b_minmax, ocmath_us_minmax, ocmath_z_minmax

Header to Include

origin.h

Reference