EigenValuesSym

Finds eigenvalues for real symmetric matrices.

Syntax

Case 1: Matrix operation

IppStatus ippmEigenValuesSym_m_32f (const Ipp32f* pSrc, int srcStride1, int srcStride2, Ipp32f* pBuffer, Ipp32f* pDstValues, int widthHeight);

IppStatus ippmEigenValuesSym_m_64f (const Ipp64f* pSrc, int srcStride1, int srcStride2, Ipp64f* pBuffer, Ipp64f* pDstValues, int widthHeight);

IppStatus ippmEigenValuesSym_m_32f_P (const Ipp32f** ppSrc, int srcRoiShift, Ipp32f* pBuffer, Ipp32f* pDstValues, int widthHeight);

IppStatus ippmEigenValuesSym_m_64f_P (const Ipp64f** ppSrc, int srcRoiShift, Ipp64f* pBuffer, Ipp64f* pDstValues, int widthHeight);

Case 2: Matrix array operation

IppStatus ippmEigenValuesSym_ma_32f (const Ipp32f* pSrc, int srcStride0, int srcStride1, int srcStride2, Ipp32f* pBuffer, Ipp32f* pDstValues, int widthHeight, int count);

IppStatus ippmEigenValuesSym_ma_32f_P (const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, Ipp32f* pBuffer, Ipp32f* pDstValues, int widthHeight, int count);

IppStatus ippmEigenValuesSym_ma_32f_L (const Ipp32f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, Ipp32f* pBuffer, Ipp32f* pDstValues, int widthHeight, int count);

IppStatus ippmEigenValuesSym_ma_64f (const Ipp64f* pSrc, int srcStride0, int srcStride1, int srcStride2, Ipp64f* pBuffer, Ipp64f* pDstValues, int widthHeight, int count);

IppStatus ippmEigenValuesSym_ma_64f_P (const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, Ipp64f* pBuffer, Ipp64f* pDstValues, int widthHeight, int count);

IppStatus ippmEigenValuesSym_ma_64f_L (const Ipp64f** ppSrc, int srcRoiShift, int srcStride1, int srcStride2, Ipp64f* pBuffer, Ipp64f* pDstValues, int widthHeight, int count );

Parameters

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).

pBuffer

Pointer to a pre-allocated auxiliary array to be used for internal computations. The number of elements in the array must be at least widthHeight

pDstValues

Pointer to the destination dense array that contains eigenvalues. The number of elements in the array must be at least widthHeight for a matrix and widthHeight*count for an array of matrices.

widthHeight

Size of the square matrix.

count

The number of matrices in the array.

Description

The function ippmEigenValuesSym is declared in the ippm.h header file.

The function finds eigenvalues for a real symmetric matrix A of size widthHeight. Each eigenvalue λ is a scalar such that

Az=λz,

for a vector z0 called an eigenvector. In case of a real symmetric matrix, all the widthHeight eigenvalues are real. The function stores eigenvalues in the array pointed by pDstValues densely and in the decreasing order.

The function uses only data in the lower triangular part of a source matrix *pSrc or *ppSrc.

The following example demonstrates how to use the function ippmEigenValuesSym_ma_32f. For more information, see also examples in Getting Started.

ippmEigenValuesSym_ma_32f

IppStatus eigenvalues_ma_32f(void){
    /* Source data: 2 matrices with width=3 and height=3 */
    Ipp32f pSrc[2*3*3]= {1, 1, 1, 
                         1, 3, 1, 
                         1, 1, 3, 
                         1, 1, 3, 
                         1, 2, 1, 
                         3, 1, 3};
    int srcStride2 = sizeof(Ipp32f);
    int srcStride1 = 3*sizeof(Ipp32f);
    int srcStride0 = 3*3*sizeof(Ipp32f);

    Ipp32f pBuffer[3*3]; /* Buffer location */
    int widthHeight = 3; int count = 2; 

    Ipp32f pDstValues[2*3]; /* Eigenvalues location for two matrices */

    IppStatus status=ippmEigenValuesSym_ma_32f((const Ipp32f*)pSrc, 
        srcStride0, srcStride1, srcStride2, pBuffer,
        pDstValues, widthHeight, count);

    /*
    // It is required for EigenValues function to check return status
    // for catching wrong result in case of invalid input data
    */
    if (status == ippStsNoErr) {
        printf_va_Ipp32f("Eigenvalues:", pDstValues, 3, 2, status);
    } else {
        printf("Function returns status: %s \n", ippGetStatusString(status));
    }
    return status; 
}

The program above produces the following output:

Eigenvalues:

4.561553 2.000000 0.438447

5.691268 1.488873 -1.180140

Return Values

ippStsOk

Indicates no errors.

ippStsNullPtrErr

Indicates an error if at least one input pointer is NULL.

ippStsSizeErr

Indicates an error if the input size parameter is less or equal to 0.

ippStsStrideMatrixErr

Indicates an error if a stride value is not positive or not divisible by the size of data type.

ippStsRoiShiftMatrixErr

Indicates an error if a roiShift value is negative or not divisible by the size of data type.

ippStsCountMatrixErr

Indicates an error when the count value is less or equal to 0.

ippStsSingularErr

Indicates an error if any of the input matrices is singular.

ippStsConvergeErr

Indicates an error if the algorithm does not converge.

Submit feedback on this help topic

Copyright © 2000 - 2010, Intel Corporation. All rights reserved.