Computes the natural logarithm of each element of a vector.
IppStatus ippsLn_32f(const Ipp32f* pSrc, Ipp32f* pDst, int len);
IppStatus ippsLn_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len);
IppStatus ippsLn_64f32f(const Ipp64f* pSrc, Ipp32f* pDst, int len);
IppStatus ippsLn_32f_I(Ipp32f* pSrcDst, int len);
IppStatus ippsLn_64f_I(Ipp64f* pSrcDst, int len);
IppStatus ippsLn_16s_Sfs(const Ipp16s* pSrc, Ipp16s* pDst, int len, int scaleFactor);
IppStatus ippsLn_32s_Sfs(const Ipp32s* pSrc, Ipp32s* pDst, int len, int scaleFactor);
IppStatus ippsLn_32s16s_Sfs(const Ipp32s* pSrc, Ipp16s* pDst, int len, int scaleFactor);
IppStatus ippsLn_16s_ISfs(Ipp16s* pSrcDst, int len, int scaleFactor);
IppStatus ippsLn_32s_ISfs(Ipp32s* pSrcDst, int len, int scaleFactor);
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 |
scaleFactor |
Scale factor, refer to Integer Scaling. |
The function ippsLn is declared in the ipps.h file. This function computes the natural logarithm of each element of the vector pSrc and stores the result in pDst as given by
pDst[n] = loge (pSrc[n])
The in-place flavors of ippsLn compute the natural logarithm of each element of the vector pSrcDst and store the result in pSrcDst as given by
pSrcDst[n] = loge (pSrcDst[n])
If the function ippsLn encounters a zero or negative value in the input, it returns a warning status and continues execution with the corresponding result value (see appendix A "Handling of Special Cases" for more information).
The example below shows how to call the function ippsLn_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. |
ippStsLnZeroArg |
Indicates a warning for zero-valued input vector elements. |
ippStsLnNegArg |
Indicates a warning for negative input vector elements. |
IppStatus ln32f(void) {
Ipp32f x[4] = {-1, (float)IPP_E, 0, (float)(exp(1.234567))};
IppStatus st = ippsLn_32f_I(x, 4);
printf_32f(“Ln =”, x, 4, st);
return st;
}
Output:
-- warning 8, Negative value(s) of argument in the Ln function
Ln = -1.#IND00 1.000000 -1.#INF00 1.234567
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.