Finds eigenvalues for real general (nonsymmetric) matrices.
Case 1: Matrix operation
IppStatus ippmEigenValues_m_32f (const Ipp32f* pSrc, int srcStride1, int srcStride2, Ipp32f* pDstValuesRe, Ipp32f* pDstValuesIm, int widthHeight, Ipp8u* pBuffer);
IppStatus ippmEigenValues_m_64f (const Ipp64f* pSrc, int srcStride1, int srcStride2, Ipp64f* pDstValuesRe, Ipp64f* pDstValuesIm, int widthHeight, Ipp8u* pBuffer);
IppStatus ippmEigenValues_m_32f_P (const Ipp32f** ppSrc, int srcRoiShift, Ipp32f* pDstValuesRe, Ipp32f* pDstValuesIm, int widthHeight, Ipp8u* pBuffer);
IppStatus ippmEigenValues_m_64f_P (const Ipp64f** ppSrc, int srcRoiShift, Ipp64f* pDstValuesRe, Ipp64f* pDstValuesIm, int widthHeight, Ipp8u* pBuffer);
Case 2: Matrix array operation
IppStatus ippmEigenValues_ma_32f (const Ipp32f* pSrc, int srcStride0, int srcStride1, int srcStride2, Ipp32f* pDstValuesRe, Ipp32f* pDstValuesIm, int widthHeight, int count, Ipp8u* pBuffer);
IppStatus ippmEigenValues_ma_64f (const Ipp64f* pSrc, int srcStride0, int srcStride1, int srcStride2, Ipp64f* pDstValuesRe, Ipp64f* pDstValuesIm, int widthHeight, int count, Ipp8u* pBuffer);
IppStatus ippmEigenValues_ma_32f_P (const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, Ipp32f* pDstValuesRe, Ipp32f* pDstValuesIm, int widthHeight, int count, Ipp8u* pBuffer);
IppStatus ippmEigenValues_ma_64f_P (const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, Ipp64f* pDstValuesRe, Ipp64f* pDstValuesIm, int widthHeight, int count, Ipp8u* pBuffer);
IppStatus ippmEigenValues_ma_32f_L (const Ipp32f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, Ipp32f* pDstValuesRe, Ipp32f* pDstValuesIm, int widthHeight, int count, Ipp8u* pBuffer);
IppStatus ippmEigenValues_ma_64f_L (const Ipp64f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, Ipp64f* pDstValuesRe, Ipp64f* pDstValuesIm, int widthHeight, int count, Ipp8u* pBuffer);
pSrc, ppSrc |
Pointer to the source matrix or array of matrices. |
srcStride0 |
Stride between matrices in the source array. |
srcStride1 |
Stride between rows in the source matrix(ces). |
srcStride2 |
Stride between elements in the source matrix(ces). |
srcRoiShift |
ROI shift in the source matrix(ces). |
pDstValuesRe |
Pointer to the dense destination array containing real parts of eigenvalues. The number of elements in the array must be at least equal to widthHeight for a matrix or widthHeight*count for an array of matrices. Note that for a complex conjugate pair of eigenvalues, the real part is stored in the array twice. |
pDstValuesIm |
Pointer to the dense destination array containing imaginary parts of eigenvalues. The number of elements in the array must be at least equal to widthHeight for a matrix or widthHeight*count for an array of matrices. Note that in a complex conjugate pair of eigenvalues, the positive imaginary part is stored in the array first. |
widthHeight |
Size of the source square matrix (matrices). |
count |
The number of matrices in the array. |
pBuffer |
Pointer to the allocated buffer used for internal computations. You should compute the buffer size using the function EigenValuesGetBufSize prior to calling ippmEigenValues. |
The function ippmEigenValues is declared in the ippm.h header file.
Given a real general (nonsymmetric) square matrix A of size widthHeight*widthHeight, the function finds eigenvalues λ such that
where zH is the conjugate transpose of z.
Real parts of eigenvalues are stored densely in the array pointed by pDstValuesRe and the imaginary parts are stored in the same order densely in the array pointed by pDstValuesIm. For a complex conjugate pair of eigenvalues, the real part is stored twice and imaginary parts are stored one after another, the positive one being stored first.
The following example demonstrates how to use the function ippmEigenValues_m_32f. For more information, see also examples in Getting Started.
IppStatus EigenValues_m_32f (void) {
/* Source data: matrix with width=4 and height=4 */
Ipp32f pSrc[4*4]= {1, 1, 1, 3,
2, 1, 3, 1,
3, 2, 0, 1,
1, 3, 1, 3};
int widthHeight=4;
int srcStride1 = 4*sizeof(Ipp32f);
int srcStride2 = sizeof(Ipp32f);
Ipp32f pDstValuesRe[4]; /* Real parts of Eigenvalues location */
Ipp32f pDstValuesIm[4]; /* Imaginary parts of Eigenvalues location */
Ipp8u* pBuffer; /* Pointer to the buffer */
int SizeBytes; /* Size of the buffer should be specified */
IppStatus status;
/* It is required to get the buffer size */
status=ippmEigenValuesGetBufSize_32f(widthHeight, &SizeBytes);
/* It is required to allocate the buffer of SizeBytes size */
pBuffer=ippsMalloc_8u(SizeBytes);
/* Call EigenValues function */
status=ippmEigenValues_m_32f((const Ipp32f*)pSrc,
srcStride1, srcStride2, pDstValuesRe, pDstValuesIm,
widthHeight, pBuffer);
ippsFree(pBuffer);
/*
// It is required for EigenValues function to check return status
// for catching wrong result in case of invalid input data
*/
if (status == ippStsOk) {
printf_va_Ipp32f("Eigenvalues real parts:", pDstValuesRe, 4, 1, status);
printf_va_Ipp32f("Eigenvalues imaginary parts:", pDstValuesIm,
4, 1, status);
} else {
printf("Function returns status: %s \n", ippGetStatusString(status));
}
return status;
}
The program above produces the following output:
Eigenvalues real parts:
6.870119 0.224240 0.224240 -2.318601
Eigenvalues imaginary parts:
0.000000 1.684493 -1.684493 0.000000
ippStsOk |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when at least one input pointer is NULL. |
ippStsSizeErr |
Indicates an error when the input size parameter is less or equal to 0. |
ippStsStrideMatrixErr |
Indicates an error when any of the stride values is not positive or not divisible by the size of the data type. |
ippStsRoiShiftMatrixErr |
Indicates an error when the RoiShift value is negative or not divisible by the size of the data type. |
ippStsCountMatrixErr |
Indicates an error when the count value is less or equal to 0. |
ippStsSingularErr |
Indicates an error when any of the input matrices is singular. |
ippStsConvergeErr |
Indicates an error when the algorithm does not converge. |
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.