Developer Reference for Intel® Integrated Performance Primitives 2018

FindNearest

Finds table elements that are closest to the elements of the specified vector.

Syntax

IppStatus ippsFindNearest_16u(const Ipp16u* pVals, Ipp16u* pOutVals, int* pOutIndexes, int len, const Ipp16u *pTable, int tblLen);

Include Files

ipps.h

Domain Dependencies

Headers: ippcore.h, ippvm.h

Libraries: ippcore.lib, ippvm.lib

Parameters

pVals

Pointer to the vector containing reference values.

pOutVals

Pointer to the output vector.

pOutIndexes

Pointer to the array that stores output indexes.

len

Number of elements in the input vector.

pTable

Pointer to the table for searching.

tblLen

Number of elements in the table.

Description

This function searches through the table pTable for elements which are closest to the reference elements of the input vector pVals. The resulting elements and their indexes are stored in pOutVals and pOutIndexes, respectively. The table elements must satisfy the condition pTable[n] pTable[n+1]. The function uses the following distance criterion for determining the table element closest to pVals[k] : min(|pVals[k] -pTable[n]|).

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when at least one of the specified pointers is NULL.

ippStsSizeErr

Indicates an error when tblLen or len is less than or equal to zero.

Example

FindNearest.c