LComb

Composes linear combination of two vectors.

Syntax

Case 1: Vector - vector operation

IppStatus ippmLComb_vv_32f(const Ipp32f* pSrc1, int src1Stride2, Ipp32f scale1, const Ipp32f* pSrc2, int src2Stride2, Ipp32f scale2, Ipp32f* pDst, int dstStride2, int len);

IppStatus ippmLComb_vv_64f(const Ipp64f* pSrc1, int src1Stride2, Ipp64f scale1, const Ipp64f* pSrc2, int src2Stride2, Ipp64f scale2, Ipp64f* pDst, int dstStride2, int len);

IppStatus ippmLComb_vv_32f_P(const Ipp32f** ppSrc1, int src1RoiShift, Ipp32f scale1, const Ipp32f** ppSrc2, int src2RoiShift, Ipp32f scale2, Ipp32f** ppDst, int dstRoiShift, int len);

IppStatus ippmLComb_vv_64f_P(const Ipp64f** ppSrc1, int src1RoiShift, Ipp64f scale1, const Ipp64f** ppSrc2, int src2RoiShift, Ipp64f scale2, Ipp64f** ppDst, int dstRoiShift, int len);

Case 2: Vector array - vector operation

IppStatus ippmLComb_vav_32f(const Ipp32f* pSrc1, int src1Stride0, int src1Stride2, Ipp32f scale1, const Ipp32f* pSrc2, int src2Stride2, Ipp32f scale2, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);

IppStatus ippmLComb_vav_64f(const Ipp64f* pSrc1, int src1Stride0, int src1Stride2, Ipp64f scale1, const Ipp64f* pSrc2, int src2Stride2, Ipp64f scale2, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);

IppStatus ippmLComb_vav_32f_P(const Ipp32f** ppSrc1, int src1RoiShift, int src1Stride0, Ipp32f scale1, const Ipp32f** ppSrc2, int src2RoiShift, Ipp32f scale2, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);

IppStatus ippmLComb_vav_64f_P(const Ipp64f** ppSrc1, int src1RoiShift, int src1Stride0, Ipp64f scale1, const Ipp64f** ppSrc2, int src2RoiShift, Ipp64f scale2, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);

IppStatus ippmLComb_vav_32f_L(const Ipp32f** ppSrc1, int src1RoiShift, int src1Stride2, Ipp32f scale1, const Ipp32f* pSrc2, int src2Stride2, Ipp32f scale2, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);

IppStatus ippmLComb_vav_64f_L(const Ipp64f** ppSrc1, int src1RoiShift, int src1Stride2, Ipp64f scale1, const Ipp64f* pSrc2, int src2Stride2, Ipp64f scale2, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);

Case 3: Vector array - vector array operation

IppStatus ippmLComb_vava_32f(const Ipp32f* pSrc1, int src1Stride0, int src1Stride2, Ipp32f scale1, const Ipp32f* pSrc2, int src2Stride0, int src2Stride2, Ipp32f scale2, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);

IppStatus ippmLComb_vava_64f(const Ipp64f* pSrc1, int src1Stride0, int src1Stride2, Ipp64f scale1, const Ipp64f* pSrc2, int src2Stride0, int src2Stride2, Ipp64f scale2, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);

IppStatus ippmLComb_vava_32f_P(const Ipp32f** ppSrc1, int src1RoiShift, int src1Stride0, Ipp32f scale1, const Ipp32f** ppSrc2, int src2RoiShift, int src2Stride0, Ipp32f scale2, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);

IppStatus ippmLComb_vava_64f_P(const Ipp64f** ppSrc1, int src1RoiShift, int src1Stride0, Ipp64f scale1, const Ipp64f** ppSrc2, int src2RoiShift, int src2Stride0, Ipp64f scale2, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);

IppStatus ippmLComb_vava_32f_L(const Ipp32f** ppSrc1, int src1RoiShift, int src1Stride2, Ipp32f scale1, const Ipp32f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp32f scale2, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);

IppStatus ippmLComb_vava_64f_L(const Ipp64f** ppSrc1, int src1RoiShift, int src1Stride2, Ipp64f scale1, const Ipp64f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp64f scale2, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);

Parameters

pSrc1, ppSrc1
Pointer to the first source vector or vector array.
src1Stride0
Stride between the vectors in the first source vector array.
src1Stride2
Stride between the elements in the first source vector(s).
src1RoiShift
ROI shift in the first source vector.
pSrc2, ppSrc2
Pointer to the second source vector or vector array.
src2Stride0
Stride between the vectors in the second source vector array.
src2Stride2
Stride between the elements in the second source vector(s).
src2RoiShift
ROI shift in the second source vector(s).
pDst, ppDst
Pointer to the destination vector or vector array.
dstStride0
Stride between the vectors in the destination array.
dstStride2
Stride between the elements in the destination vector.
dstRoiShift
ROI shift in the destination vector.
scale1
First multiplier.
scale2
Second multiplier.
len
Vector length.
count
Number of vectors in the array.

Description

The function ippmLComb is declared in the ippm.h header file. The function composes a linear combination of two vectors by multiplying the first source vector by scale1, adding the result to the second source vector multiplied by scale2, and storing the resulting vector in pDst.

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

ippmLComb_vava_32f  

IppStatus lcomb_vava_32f(void) {
    /* Src1 data: 4 vectors with length=3, Stride2=2*sizeof(Ipp32f) */
    Ipp32f pSrc1[4*6] = { 1, 0,  2,  0, 3,  0,
                          4, 0,  5,  0, 6,  0,
                          7, 0,  8,  0, 9,  0,
                          6, 0,  4,  0, 2, 0 };
 
    int src1Stride2 = 2*sizeof(Ipp32f);
    int src1Stride0 = 6*sizeof(Ipp32f);
 
   /* Src2 data: 4 vectors with length=3, Stride2=sizeof(Ipp32f) */
    Ipp32f pSrc2[4*3] = { -3, -1, -2,
                          -7, -3, -4,
                          -4, -5, -6,
                          -5, -2, -3 };
 
    int src2Stride2 = sizeof(Ipp32f);
    int src2Stride0 = 3*sizeof(Ipp32f);
 
    /* Dst is 4 vectors with length=3, Stride2=sizeof(Ipp32f) */
    Ipp32f pDst[4*3];
    int dstStride2=sizeof(Ipp32f);
    int dstStride0=3*sizeof(Ipp32f);
 
    Ipp32f scale1 = 0.5;
    Ipp32f scale2 = 1.5;
    int length = 3;
    int count  = 4;
 
    IppStatus status = ippmLComb_vava_32f((const Ipp32f*)pSrc1,
        src1Stride0, src1Stride2, scale1,
        (const Ipp32f*)pSrc2, src2Stride0, src2Stride2, scale2,
        pDst, dstStride0, dstStride2, length, count);
 
 
    /*
    // It is recommended to check return status 
    // to detect wrong input parameters, if any  
    */
    if (status == ippStsNoErr) {
        printf_va_Ipp32f("4 destination vectors:", pDst, 3, 4, status);
    } else {
        printf("Function returns status: %s \n", ippGetStatusString(status));
    }
    return status;
}
 

The program above produces the following output:

4 destination vectors:

-4.000000  -0.500000  -1.500000

-8.500000  -2.000000  -3.000000

-2.500000  -3.500000  -4.500000

-4.500000  -1.000000  -3.500000

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 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 - 2011, Intel Corporation. All rights reserved.