Computes the inverse of vector elements after limiting their magnitudes by the given lower bound.
IppStatus ippsThreshold_LTInv_32f(const Ipp32f* pSrc, Ipp32f* pDst, int len, Ipp32f level);
IppStatus ippsThreshold_LTInv_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len, Ipp64f level);
IppStatus ippsThreshold_LTInv_32fc(const Ipp32fc* pSrc, Ipp32fc* pDst, int len, Ipp32f level);
IppStatus ippsThreshold_LTInv_64fc(const Ipp64fc* pSrc, Ipp64fc* pDst, int len, Ipp64f level);
IppStatus ippsThreshold_LTInv_32f_I(Ipp32f* pSrcDst, int len, Ipp32f level);
IppStatus ippsThreshold_LTInv_64f_I(Ipp64f* pSrcDst, int len, Ipp64f level);
IppStatus ippsThreshold_LTInv_32fc_I(Ipp32fc* pSrcDst, int len, Ipp32f level);
IppStatus ippsThreshold_LTInv_64fc_I(Ipp64fc* pSrcDst, int len, Ipp64f level);
pSrc |
Pointer to the source vector. |
pDst |
Pointer to the destination vector. |
pSrcDst |
Pointer to the source and destination vector for the in-place operation. |
len |
Number of elements in the vector. |
level |
Value used to limit each element of pSrc or pSrcDst.This argument must always be real and positive. |
The function ippsThreshold_LTInv is declared in the ipps.h file. This function computes the inverse of elements of the vector pSrc and stores the result in pDst. The computation occurs after first limiting the magnitude of each element by the threshold value level.
The in-place flavors of ippsThreshold_LTInv compute the inverse of elements of the vector pSrcDst and store the result in pSrcDst. The computation occurs after first limiting the magnitude of each element by the threshold value level.
The threshold operation is performed to avoid division by zero. Since level represents a magnitude, it is always real and must be positive. The formula for ippsThreshold_LTInv is the following:
If the function encounters zero-valued vector elements and level is also 0 (see appendix A "Handling of Special Cases"), the output value is set to Inf (infinity), but operation execution is not aborted:
The example below shows how to use the function ippsThreshold_LTInv_32f_I.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when the pSrc, pDst, or pSrcDst pointer is NULL. |
ippStsSizeErr |
Indicates an error when len is less than or equal to 0. |
ippStsThreshNegLevelErr |
Indicates an error when level is negative. |
ippStsInvZero |
Indicates a warning when level and a vector element are equal to 0. Operation execution is not aborted. The value of the destination vector element is Inf. |
IppStatus invThreshold(void) {
Ipp32f x[4] = {-1, 0, 2, 3};
IppStatus st = ippsThreshold_LTInv_32f_I(x, 4, 0);
printf_32f("inv threshold =", x, 4, st);
return st;
}
Output:
-- warning 4, INF result. Zero value met by invThreshold with zero level
inv threshold = -1.000000 1.#INF00 0.500000 0.333333
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.