Det

Computes matrix determinant.

Syntax

Case 1: Matrix operation

IppStatus ippmDet_m_32f(const Ipp32f* pSrc, int srcStride1, int srcStride2, int widthHeight, Ipp32f* pBuffer, Ipp32f* pDst);

IppStatus ippmDet_m_64f(const Ipp64f* pSrc, int srcStride1, int srcStride2, int widthHeight, Ipp64f* pBuffer, Ipp64f* pDst);

IppStatus ippmDet_m_32f_P(const Ipp32f** ppSrc, int srcRoiShift, int widthHeight, Ipp32f* pBuffer, Ipp32f* pDst);

IppStatus ippmDet_m_64f_P(const Ipp64f** ppSrc, int srcRoiShift, int widthHeight, Ipp64f* pBuffer, Ipp64f* pDst);

Case 2: Matrix array operation

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

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

IppStatus ippmDet_ma_32f_P(const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, int widthHeight, Ipp32f* pBuffer, Ipp32f* pDst, int count);

IppStatus ippmDet_ma_64f_P(const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, int widthHeight, Ipp64f* pBuffer, Ipp64f* pDst, int count);

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

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

Parameters

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.

widthHeight

Size of the square matrix.

pBuffer

Pointer to a pre-allocated buffer to be used for internal computations. Size of the buffer must be at least widthHeight2+ widthHeight.

count

Number of matrices in the array.

Description

The function ippmDet is declared in the ippm.h header file. The function calculates the determinant of the source matrix and stores the result in pDst. Upon completion,

dst = det(src).

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 ippmDet_ma_32f. For more information, see also examples in Getting Started.

ippmDet_ma_32f  

IppStatus det_ma_32f(void) {
    /* Source data: 2 matrices with widthHeight=3 */
    Ipp32f pSrc[8*3] = { 5.0f, 1.1f, 1.2f,
                         1.3f, 1.4f, 1.5f,
                         2.0f, 2.1f, 2.2f,
                         0.0f, 0.0f, 0.0f,
                         6.3f, 2.4f, 2.5f,
                         3.0f, 3.1f, 3.2f,
                         4.3f, 4.4f, 4.5f,
                         0.0f, 0.0f, 0.0f };
    /* Standard description for 2 source matrices */
    int srcStride2 = sizeof(Ipp32f);
    int srcStride1 = 3*sizeof(Ipp32f);
    int srcStride0 = 4*3*sizeof(Ipp32f);

    int widthHeight = 3;
    int count = 2;

    Ipp32f pDst[2];         /* Destination is array of values */
    Ipp32f pBuffer[3*3+3];  /* Buffer location */

    IppStatus status = ippmDet_ma_32f((const Ipp32f*)pSrc, srcStride0,
        srcStride1, srcStride2, widthHeight, pBuffer, pDst, count);
    /*
    // It is recommended to check return status
    // to detect wrong input parameters, if any
    */
    if (status == ippStsNoErr) {
        printf_va_Ipp32f("Dst is 2 values:", pDst, 2, 1, status);
    } else {
        printf("Function returns status: %s \n", ippGetStatusString(status));
    } 
    return status;
}
 

The program above produces the following output:

Dst is 2 values:

-0.279999  -0.520004

Return Values

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.

Submit feedback on this help topic

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