CholeskyBackSubst

Solves system of linear equations using the Cholesky triangular factor.

Syntax

Case 1: Matrix -vector operation

IppStatus ippmCholeskyBackSubst_mv_32f(const Ipp32f* pSrc1, int src1Stride1, int src1Stride2, const Ipp32f* pSrc2, int src2Stride2, Ipp32f* pDst, int dstStride2, int widthHeight);

IppStatus ippmCholeskyBackSubst_mv_64f(const Ipp64f* pSrc1, int src1Stride1, int src1Stride2, const Ipp64f* pSrc2, int src2Stride2, Ipp64f* pDst, int dstStride2, int widthHeight);

IppStatus ippmCholeskyBackSubst_mv_32f_P(const Ipp32f** ppSrc1, int src1RoiShift, const Ipp32f** ppSrc2, int src2RoiShift, Ipp32f** ppDst, int dstRoiShift, int widthHeight);

IppStatus ippmCholeskyBackSubst_mv_64f_P(const Ipp64f** ppSrc1, int src1RoiShift, const Ipp64f** ppSrc2, int src2RoiShift, Ipp64f** ppDst, int dstRoiShift, int widthHeight);

Case 2: Matrix - vector array operation

IppStatus ippmCholeskyBackSubst_mva_32f(const Ipp32f* pSrc1, int src1Stride1, int src1Stride2, const Ipp32f* pSrc2, int src2Stride0, int src2Stride2, Ipp32f* pDst, int dstStride0, int dstStride2, int widthHeight, int count);

IppStatus ippmCholeskyBackSubst_mva_64f(const Ipp64f* pSrc1, int src1Stride1, int src1Stride2, const Ipp64f* pSrc2, int src2Stride0, int src2Stride2, Ipp64f* pDst, int dstStride0, int dstStride2, int widthHeight, int count);

IppStatus ippmCholeskyBackSubst_mva_32f_P(const Ipp32f** ppSrc1, int src1RoiShift, const Ipp32f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int widthHeight, int count);

IppStatus ippmCholeskyBackSubst_mva_64f_P(const Ipp64f** ppSrc1, int src1RoiShift, const Ipp64f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int widthHeight, int count);

IppStatus ippmCholeskyBackSubst_mva_32f_L(const Ipp32f* pSrc1, int src1Stride1, int src1Stride2, const Ipp32f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int widthHeight, int count);

IppStatus ippmCholeskyBackSubst_mva_64f_L(const Ipp64f* pSrc1, int src1Stride1, int src1Stride2, const Ipp64f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int widthHeight, int count);

Case 3: Matrix array - vector array operation

IppStatus ippmCholeskyBackSubst_mava_32f(const Ipp32f* pSrc1, int src1Stride0, int src1Stride1, int src1Stride2, const Ipp32f* pSrc2, int src2Stride0, int src2Stride2, Ipp32f* pDst, int dstStride0, int dstStride2, int widthHeight, int count);

IppStatus ippmCholeskyBackSubst_mava_64f(const Ipp64f* pSrc1, int src1Stride0, int src1Stride1, int src1Stride2, const Ipp64f* pSrc2, int src2Stride0, int src2Stride2, Ipp64f* pDst, int dstStride0, int dstStride2, int widthHeight, int count);

IppStatus ippmCholeskyBackSubst_mava_32f_P(const Ipp32f** ppSrc1, int src1RoiShift, int src1Stride2, const Ipp32f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int widthHeight, int count);

IppStatus ippmCholeskyBackSubst_mava_64f_P(const Ipp64f** ppSrc1, int src1RoiShift, int src1Stride2, const Ipp64f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int widthHeight, int count);

IppStatus ippmCholeskyBackSubst_mava_32f_L(const Ipp32f** ppSrc1, int src1RoiShift, int src1Stride1, int src1Stride2, const Ipp32f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int widthHeight, int count);

IppStatus ippmCholeskyBackSubst_mava_64f_L(const Ipp64f** ppSrc1, int src1RoiShift, int src1Stride1, int src1Stride2, const Ipp64f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int widthHeight, int count);

Parameters

pSrc1, ppSrc1

Pointer to the source matrix or array of matrices. Must be a result of calling CholeskyDecomp.

src1Stride0

Stride between the matrices in the source array.

src1Stride1

Stride between the rows in the source matrix(ces).

src1Stride2

Stride between the elements in the source matrix(ces).

src1RoiShift

ROI shift in the source matrix(ces).

pSrc2, ppSrc2

Pointer to the source vector or array of vectors.

src2Stride0

Stride between the vectors in the source array.

src2Stride1

Stride between the elements in the source vector(s).

src2RoiShift

ROI shift in the source vector(s).

pDst, ppDst

Pointer to the destination vector or array of vectors.

dstStride0

Stride between the vectors in the destination array.

dstStride2

Stride between the elements in the destination vector(s).

dstRoiShift

ROI shift in the destination vector(s).

widthHeight

Size of the square matrix, the source vector, and the destination vector.

count

Number of matrices and right-hand part vectors in the arrays.

Description

The function ippmCholeskyBackSubst is declared in the ippm.h header file. The function solves for x the following systems of linear equations:

where A is the matrix of linear equations system, stored in pSrc1 or ppSrc1, b is the vector of the right-hand side, stored in pSrc2 or ppSrc2, x is the unknown vector, stored in pDst or ppDst.

You should call the function ippmCholeskyDecomp to perform Cholesky decomposition of A before calling ippmCholeskyBackSubst.

The following example demonstrates how to use the functions ippmCholeskyDecomp_m_32f and ippmCholeskyBackSubst_mva_32f. For more information, see also examples in Getting Started.

ippmCholesky_mva_32f  

IppStatus cholesky_mva_32f(void){
    /* Source matrix with widthHeight=4 */
    Ipp32f pSrc[4*4] = { 10, 1,  2, 3,
                         1, 12,  4, 5,
                         2,  4, 13, 6,
                         3,  5,  6, 14 };
    int srcStride2 = sizeof(Ipp32f);
    int srcStride1 = 4*sizeof(Ipp32f);

    /* Solver right-part is 3 vectors with length=4 */
    Ipp32f pSrc2[3*4] = {1, 2,  3,  4,
                         5, 6,  7,  8,
                         9, 10, 11, 12 };
    int src2Stride2 = sizeof(Ipp32f);
    int src2Stride0 = 4*sizeof(Ipp32f);

    Ipp32f pDecomp[4*4] = {0}; /* Decomposed matrix location */
    int decompStride2 = sizeof(Ipp32f);
    int decompStride1 = 4*sizeof(Ipp32f);

    Ipp32f pDst[3*4];          /* Solver destination location */
    int dstStride2 = sizeof(Ipp32f);
    int dstStride0 = 4*sizeof(Ipp32f);

    int widthHeight = 4;
    int count = 3;

    IppStatus status = ippmCholeskyDecomp_m_32f((const Ipp32f*)pSrc,
        srcStride1, srcStride2, pDecomp, decompStride1,
        decompStride2, widthHeight);

    /*
    // It is required for Cholesky decomposition function to check return status 
    // for catching wrong result in case of invalid input data 
    */
    if (status == ippStsNoErr) {
        status = ippmCholeskyBackSubst_mva_32f((const Ipp32f*)pDecomp, 
            decompStride1, decompStride2, pSrc2, src2Stride0, src2Stride2,
            pDst, dstStride0, dstStride2, widthHeight, count);

        printf_m_Ipp32f("Cholesky decomposition:", pDecomp, 4, 4, status);
        printf_va_Ipp32f("3 destination vectors:", pDst, 4, 3, status);

    } else {
        printf("Function returns status: %s \n", ippGetStatusString(status));
    } 
                    
    return status;
}

The program above produces the following output:

Cholesky decomposition:

0.316228 0.000000 0.000000 0.000000

0.316228 0.289886 0.000000 0.000000

0.632456 1.101565 0.296349 0.000000

0.948683 1.362462 1.155513 0.317685

3 destination vectors:

0.006629 0.034783 0.116639 0.221883

0.332266 0.260316 0.273350 0.290109

0.657903 0.485848 0.430061 0.358335

Return Values

ippStsOk

Returns no error.

ippStsNullPtrErr

Returns an error when at least one input pointer is NULL.

ippStsSizeErr

Returns an error when the size of the source matrix is 0.

ippStsStrideMatrixErr

Returns an error when the stride value is not positive or not divisible by size of data type.

ippStsRoiShiftMatrixErr

Returns an error when the roiShift value is negative or not divisible by size of data type.

ippStsCountMatrixErr

Returns an error when the count value is less or equal to zero.

Submit feedback on this help topic

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