Finds table elements that are closest to the elements of the specified vector.
IppStatus ippsFindNearest_16u(const Ipp16u* pVals, Ipp16u* pOutVals, int* pOutIndexes, int len, const Ipp16u *pTable, int tblLen);
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. |
The function ippsFindNearest is declared in the ipps.h file. 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]|).
The example below shows how to use the function ippsFindNearest.
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 0. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.