Subtracts constant from vector, vector from constant, or vector from another vector.
Case 1: Vector - constant operation
IppStatus ippmSub_vc_32f(const Ipp32f* pSrc, int srcStride2, Ipp32f val, Ipp32f* pDst, int dstStride2, int len);
IppStatus ippmSub_vc_64f(const Ipp64f* pSrc, int srcStride2, Ipp64f val, Ipp64f* pDst, int dstStride2, int len);
IppStatus ippmSub_vc_32f_P(const Ipp32f** ppSrc, int srcRoiShift, Ipp32f val, Ipp32f** ppDst, int dstRoiShift, int len);
IppStatus ippmSub_vc_64f_P(const Ipp64f** ppSrc, int srcRoiShift, Ipp64f val, Ipp64f** ppDst, int dstRoiShift, int len);
Case 2: Vector array - constant operation
IppStatus ippmSub_vac_32f(const Ipp32f* pSrc, int srcStride0, int srcStride2, Ipp32f val, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vac_64f(const Ipp64f* pSrc, int srcStride0, int srcStride2, Ipp64f val, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vac_32f_P(const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, Ipp32f val, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vac_64f_P(const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, Ipp64f val, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vac_32f_L(const Ipp32f** ppSrc, int srcRoiShift, int srcStride2, Ipp32f val, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
IppStatus ippmSub_vac_64f_L(const Ipp64f** ppSrc, int srcRoiShift, int srcStride2, Ipp64f val, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
Case 3: Vector array - constant array operation
IppStatus ippmSub_vaca_32f (const Ipp32f* pSrc, int srcStride0, int srcStride2, const Ipp32f* pVal, int valStride0, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vaca_64f (const Ipp64f* pSrc, int srcStride0, int srcStride2, const Ipp64f* pVal, int valStride0, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vaca_32f_P (const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, const Ipp32f* pVal, int valStride0, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vaca_64f_P (const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, const Ipp64f* pVal, valStride0, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vaca_32f_L (const Ipp32f** ppSrc, int srcRoiShift, int srcStride2, const Ipp32f** ppVal, int valRoiShift, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
IppStatus ippmSub_vaca_64f_L (const Ipp64f** ppSrc, int srcRoiShift, int srcStride2, const Ipp64f** ppVal, int valRoiShift, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
Case 4: Vector - constant array operation
IppStatus ippmSub_vca_32f (const Ipp32f* pSrc, int srcStride2, const Ipp32f* pVal, int valStride0, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vca_64f (const Ipp64f* pSrc, int srcStride2, const Ipp64f* pVal, int valStride0, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vca_32f_P (const Ipp32f** ppSrc, int srcRoiShift, const Ipp32f* pVal, int valStride0, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vca_64f_P (const Ipp64f** ppSrc, int srcRoiShift, const Ipp64f* pVal, int valStride0, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vca_32f_L (const Ipp32f* pSrc, int srcStride2, const Ipp32f** ppVal, int valRoiShift, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
IppStatus ippmSub_vca_64f_L (const Ipp64f* pSrc, int srcStride2, const Ipp64f** ppVal, int valRoiShift, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
Case 5: Constant - vector operation
IppStatus ippmSub_cv_32f(const Ipp32f* pSrc, int srcStride2, Ipp32f val, Ipp32f* pDst, int dstStride2, int len);
IppStatus ippmSub_cv_64f(const Ipp64f* pSrc, int srcStride2, Ipp64f val, Ipp64f* pDst, int dstStride2, int len);
IppStatus ippmSub_cv_32f_P(const Ipp32f** ppSrc, int srcRoiShift, Ipp32f val, Ipp32f** ppDst, int dstRoiShift, int len);
IppStatus ippmSub_cv_64f_P(const Ipp64f** ppSrc, int srcRoiShift, Ipp64f val, Ipp64f** ppDst, int dstRoiShift, int len);
Case 6: Constant - vector array operation
IppStatus ippmSub_cva_32f(const Ipp32f* pSrc, int srcStride0, int srcStride2, Ipp32f val, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_cva_64f(const Ipp64f* pSrc, int srcStride0, int srcStride2, Ipp64f val, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_cva_32f_P(const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, Ipp32f val, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_cva_64f_P(const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, Ipp64f val, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_cva_32f_L(const Ipp32f** ppSrc, int srcRoiShift, int srcStride2, Ipp32f val, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
IppStatus ippmSub_cva_64f_L(const Ipp64f** ppSrc, int srcRoiShift, int srcStride2, Ipp64f val, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
Case 7: Constant array - vector array operation
IppStatus ippmSub_cava_32f (const Ipp32f* pSrc, int srcStride0, int srcStride2, const Ipp32f* pVal, int valStride0, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_cava_64f (const Ipp64f* pSrc, int srcStride0, int srcStride2, const Ipp64f* pVal, int valStride0, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_cava_32f_P (const Ipp32f** ppSrc, int srcRoiShift, int srcStride0, const Ipp32f* pVal, int valStride0, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_cava_64f_P (const Ipp64f** ppSrc, int srcRoiShift, int srcStride0, const Ipp64f* pVal, int valStride0, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_cava_32f_L (const Ipp32f** ppSrc, int srcRoiShift, int srcStride2, const Ipp32f** ppVal, int valRoiShift, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
IppStatus ippmSub_cava_64f_L (const Ipp64f** ppSrc, int srcRoiShift, int srcStride2, const Ipp64f** ppVal, int valRoiShift, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
Case 8: Constant array - vector operation
IppStatus ippmSub_cav_32f (const Ipp32f* pSrc, int srcStride2, const Ipp32f* pVal, int valStride0, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_cav_64f (const Ipp64f* pSrc, int srcStride2, const Ipp64f* pVal, int valStride0, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_cav_32f_P (const Ipp32f** ppSrc, int srcRoiShift, const Ipp32f* pVal, int valStride0, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_cav_64f_P (const Ipp64f** ppSrc, int srcRoiShift, const Ipp64f* pVal, int valStride0, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_cav_32f_L (const Ipp32f* pSrc, int srcStride2, const Ipp32f** ppVal, int valRoiShift, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
IppStatus ippmSub_cav_64f_L (const Ipp64f* pSrc, int srcStride2, const Ipp64f** ppVal, int valRoiShift, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
Case 9: Vector - vector operation
IppStatus ippmSub_vv_32f(const Ipp32f* pSrc1, int src1Stride2, const Ipp32f* pSrc2, int src2Stride2, Ipp32f* pDst, int dstStride2, int len);
IppStatus ippmSub_vv_64f(const Ipp64f* pSrc1, int src1Stride2, const Ipp64f* pSrc2, int src2Stride2, Ipp64f* pDst, int dstStride2, int len);
IppStatus ippmSub_vv_32f_P(const Ipp32f** ppSrc1, int src1RoiShift, const Ipp32f** ppSrc2, int src2RoiShift, Ipp32f** ppDst, int dstRoiShift, int len);
IppStatus ippmSub_vv_64f_P(const Ipp64f** ppSrc1, int src1RoiShift, const Ipp64f** ppSrc2, int src2RoiShift, Ipp64f** ppDst, int dstRoiShift, int len);
Case 10: Vector - vector array operation
IppStatus ippmSub_vva_32f(const Ipp32f* pSrc1, int src1Stride2, const Ipp32f* pSrc2, int src2Stride0, int src2Stride2, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vva_64f(const Ipp64f* pSrc1, int src1Stride2, const Ipp64f* pSrc2, int src2Stride0, int src2Stride2, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vva_32f_P(const Ipp32f** ppSrc1, int src1RoiShift, const Ipp32f** ppSrc2, int src2RoiShift , int src2Stride0, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vva_64f_P(const Ipp64f** ppSrc1, int src1RoiShift, const Ipp64f** ppSrc2, int src2RoiShift, int src2Stride0, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vva_32f_L(const Ipp32f* pSrc1, int src1Stride2, const Ipp32f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
IppStatus ippmSub_vva_64f_L(const Ipp64f* pSrc1, int src1Stride2, const Ipp64f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
Case 11: Vector array - vector operation
IppStatus ippmSub_vav_32f(const Ipp32f* pSrc1, int src1Stride0, int src1Stride2, const Ipp32f* pSrc2, int src2Stride2, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vav_64f(const Ipp64f* pSrc1, int src1Stride0, int src1Stride2, const Ipp64f* pSrc2, int src2Stride2, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vav_32f_P(const Ipp32f** ppSrc1, int src1RoiShift, int src1Stride0, const Ipp32f** ppSrc2, int src2RoiShift, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vav_64f_P(const Ipp64f** ppSrc1, int src1RoiShift, int src1Stride0, const Ipp64f** ppSrc2, int src2RoiShift, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vav_32f_L(const Ipp32f** ppSrc1, int src1RoiShift, int src1Stride2, const Ipp32f* pSrc2, int src2Stride2, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
IppStatus ippmSub_vav_64f_L(const Ipp64f** ppSrc1, int src1RoiShift, int src1Stride2, const Ipp64f* pSrc2, int src2Stride2, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
Case 12: Vector array - vector array operation
IppStatus ippmSub_vava_32f(const Ipp32f* pSrc1, int src1Stride0, int src1Stride2, const Ipp32f* pSrc2, int src2Stride0, int src2Stride2, Ipp32f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vava_64f(const Ipp64f* pSrc1, int src1Stride0, int src1Stride2, const Ipp64f* pSrc2, int src2Stride0, int src2Stride2, Ipp64f* pDst, int dstStride0, int dstStride2, int len, int count);
IppStatus ippmSub_vava_32f_P(const Ipp32f** ppSrc1, int src1RoiShift, int src1Stride0, const Ipp32f** ppSrc2, int src2RoiShift, int src2Stride0, Ipp32f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vava_64f_P(const Ipp64f** ppSrc1, int src1RoiShift, int src1Stride0, const Ipp64f** ppSrc2, int src2RoiShift, int src2Stride0, Ipp64f** ppDst, int dstRoiShift, int dstStride0, int len, int count);
IppStatus ippmSub_vava_32f_L(const Ipp32f** ppSrc1, int src1RoiShift, int src1Stride2, const Ipp32f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp32f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
IppStatus ippmSub_vava_64f_L(const Ipp64f** ppSrc1, int src1RoiShift, int src1Stride2, const Ipp64f** ppSrc2, int src2RoiShift, int src2Stride2, Ipp64f** ppDst, int dstRoiShift, int dstStride2, int len, int count);
pSrc, ppSrc |
Pointer to the source vector or vector array. |
srcStride0 |
Stride between the vectors in the source array. |
srcStride2 |
Stride between the elements in the source vector(s). |
srcRoiShift |
ROI shift in the source vector. |
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). |
val |
The constant. |
pVal, ppVal |
Pointer to the source array of constants. |
valStride0 |
Stride between the constants in the source array of constants. |
valRoiShift |
ROI shift for the source array of constants. |
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. |
len |
Vector length. |
count |
The number of vectors (constants) in the array. |
The function ippmSub is declared in the ippm.h header file. Like all other Intel IPP matrix operating functions, this function is parameter sensitive. All input parameters that follow the function name immediately after the underscore determine the way in which the function performs and the arguments it takes, whether it is a constant or another vector. This implies that with every complete function name only some of the listed arguments appear in the input list, while others are omitted.
When the function is performed on a vector and a constant, it
subtracts val from each element of the source
vector and stores the result in the destination vector:
When the function is performed on a constant and a vector, it
subtracts each element of the source vector from val and
stores the result in the destination vector:
To clarify how the function operates on arrays of vectors and constants, see Operations with arrays of objects.
When the function is performed on two vectors, it subtracts the
elements of the second source vector from the respective elements
of the first source vector and stores the result in the destination
vector:
To clarify how the function operates on two arrays of vectors, see Operations with arrays of objects.
Examples of calling the function ippmSub operating with arrays of constants are similar to those of the function ippmAdd (see Example “ippmAdd_vaca_32f”, Example “ippmAdd_vaca_32f_L”, and Example “ippmAdd_vca_32f_P”).
The following example demonstrates how to use the function ippmSub_vav_32f_P. For more information, see also examples in Getting Started.
IppStatus sub_vav_32f_P(void) {
/* Source data */
Ipp32f src1[3*4] = { 11, 21, 31, 41,
12, 22, 32, 42,
13, 23, 33, 43 };
Ipp32f src2[3] = { 1, 2, 3 };
/*
// The first operand is 4 vector-columns with length=3
// Pointer description:
// ppSrc1[0] pointer to the first element of the first column
// ppSrc1[1] pointer to the second element of the first column
// ppSrc1[2] pointer to the third element of the first column
*/
Ipp32f* ppSrc1[3] = { src1, src1+4, src1+8 };
int src1RoiShift = 0;
int src1Stride0 = sizeof(Ipp32f); /* Stride between columns */
/*
// The second operand is vector with length=3
// Pointer description:
// ppSrc2[0] pointer to the first element
// ppSrc2[1] pointer to the second element
// ppSrc2[2] pointer to the third element
*/
Ipp32f* ppSrc2[3] = { src2, src2+1, src2+2 };
int src2RoiShift = 0;
/*
// Destination is 4 vectors with length=3
// Pointer description for destination vectors
*/
Ipp32f dst[12];
int length = 3;
int count = 4;
Ipp32f* ppDst[3] = { dst, dst+1, dst+2 };
int dstRoiShift = 0;
int dstStride0 = sizeof(Ipp32f)*3; /* Stride between vectors */
IppStatus status = ippmSub_vav_32f_P((const Ipp32f**)ppSrc1,
src1RoiShift, src1Stride0, (const Ipp32f**)ppSrc2, src2RoiShift,
ppDst, dstRoiShift, dstStride0, length, count);
/*
// It is recommended to check return status
// to detect wrong input parameters, if any
*/
if (status == ippStsNoErr) {
printf_va_Ipp32f("Dst is 4 vectors:", dst, 3, 4, status);
} else {
printf("Function returns status: %s \n", ippGetStatusString(status));
}
return status;
}
The program above produces the following output:
Dst is 4 vectors:
10.000000 10.000000 10.000000
20.000000 20.000000 20.000000
30.000000 30.000000 30.000000
40.000000 40.000000 40.000000
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. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.