Computes matrix Frobenius.
Case 1: Matrix operation
IppStatus ippmFrobNorm_m_32f(const Ipp32f* pSrc, int srcStride1, int srcStride2, int width, int height, Ipp32f* pDst);
IppStatus ippmFrobNorm_m_64f(const Ipp64f* pSrc, int srcStride1, int srcStride2, int width, int height, Ipp64f* pDst);
IppStatus ippmFrobNorm_m_32f_P(const Ipp32f** ppSrc, int srcRoiShift, int width, int height, Ipp32f* pDst);
IppStatus ippmFrobNorm_m_64f_P(const Ipp64f** ppSrc, int srcRoiShift, int width, int height, Ipp64f* pDst);
Case 2: Matrix array operation
IppStatus ippmFrobNorm_ma_32f(const Ipp32f* pSrc, int srcStride0, int srcStride1, int srcStride2, int width, int height, Ipp32f* pDst, int count);
IppStatus ippmFrobNorm_ma_64f(const Ipp64f* pSrc, int srcStride0, int srcStride1, int srcStride2, int width, int height, Ipp64f* pDst, int count);
IppStatus ippmFrobNorm_ma_32f_P(const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, int width, int height, Ipp32f* pDst, int count);
IppStatus ippmFrobNorm_ma_64f_P(const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, int width, int height, Ipp64f* pDst, int count);
IppStatus ippmFrobNorm_ma_32f_L(const Ipp32f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, int width, int height, Ipp32f* pDst, int count);
IppStatus ippmFrobNorm_ma_64f_L(const Ipp64f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, int width, int height, Ipp64f* pDst, int count);
pSrc, ppSrc |
Pointer to the source matrix or array of matrices. |
srcStride0 |
Stride between the matrices in the source array. |
srcStride1 |
Stride between the rows in the source matrix(ces). |
srcStride2 |
Stride between the elements in the source matrix(ces). |
srcRoiShift |
ROI shift in the source matrix(ces). |
pDst |
Pointer to the destination value or array of values. |
width |
Matrix width. |
height |
Matrix height. |
count |
Number of matrices in the array. |
The function ippmFrobNorm is declared in the
ippm.h header file. The function calculates Frobenius
norm of the source matrix and stores the result in pDst.
The destination value is the square root of the sum of all the squared
elements in the source matrix, or
If the operation is performed on a vector array, the resulting values are stored sequentially in the array with the pointer pDst.
The following example demonstrates how to use the function ippmFrobNorm_ma_32f_L. For more information, see also examples in Getting Started.
IppStatus frobnorm_ma_32f_L(void) { /* Source data */ Ipp32f a[2*3] = { 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f }; Ipp32f b[2*3] = { 2.0f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f }; Ipp32f c[2*3] = { 3.0f, 3.1f, 3.2f, 3.3f, 3.4f, 3.5f }; Ipp32f d[2*3] = { 4.0f, 4.1f, 4.2f, 4.3f, 4.4f, 4.5f }; /* // Layout description for 4 source matrices: */ int width = 3; int height = 2; int count = 4; Ipp32f* ppSrc[4] = { a, b, c, d }; int srcRoiShift = 0; int srcStride2 = sizeof(Ipp32f); int srcStride1 = 3*sizeof(Ipp32f); Ipp32f pDst[4]; /* Destination is array of values */ IppStatus status = ippmFrobNorm_ma_32f_L((const Ipp32f**)ppSrc, srcRoiShift, srcStride1, srcStride2, width, height, pDst, count); /*
// It is recommended to check return status
// to detect wrong input parameters, if any
*/
if (status == ippStsNoErr) {
printf_va_Ipp32f("Dst is 4 values:", pDst, 4, 1, status);
} else {
printf("Function returns status: %s \n", ippGetStatusString(status));
}
return status; }
The program above produces the following output:
Dst is 4 values:
3.090307 5.527205 7.971826 10.418734
ippStsOk |
Returns no error. |
ippStsNullPtrErr |
Returns an error when at least one input pointer is NULL. |
ippStsSizeErr |
Returns an error when the input size parameter is equal to 0. |
ippStsStrideMatrixErr |
Returns an error when the stride value is not positive or not divisible by the size of the data type. |
ippStsRoiShiftMatrixErr |
Returns an error when the roiShift value is negative or not divisible by the size of the data type. |
ippStsCountMatrixErr |
Returns an error when the count value is less or equal to zero. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.