Community
cancel
Showing results for
Did you mean:
Highlighted
Beginner
34 Views

## Meaning of "Step" in ippsSVD_64f_D2?

Hello all,

what is the meaning of the "step" term in the ippsSVD_64f_D2(...) function documentation? I'm trying to perform the SVD of a 3x3 matrix (passed as a vector[3x3] to the function). Is the step just 3 in my case? Or is it referring to the number of bytes per row...or something else? For example, from the docs:

"pSrcA -> Pointer to the input vector A[height*step]."

-L
2 Replies
Highlighted
Employee
34 Views

According documentation step is Row step in the vector pSrcA, pSrcDstA, or pDstV. It means distance in bytes between two adjacent rows.

Regards,
Employee
34 Views
Quoting - lkeene
Hello all,

what is the meaning of the "step" term in the ippsSVD_64f_D2(...) function documentation? I'm trying to perform the SVD of a 3x3 matrix (passed as a vector[3x3] to the function). Is the step just 3 in my case? Or is it referring to the number of bytes per row...or something else? For example, from the docs:

"pSrcA -> Pointer to the input vector A[height*step]."

-L

Hi
Yes, the step is 3 in your case. For square matrix, it is height=step=width.

Here is one sample

#include "stdafx.h"
#include "ipp.h"
int _tmain(int argc, _TCHAR* argv[])
{
const IppLibraryVersion* ippVersion = ippiGetLibVersion();

printf("IPP: [ %s %s ]", ippVersion->Name, ippVersion->Version);

//Ipp64f pSrcA[3*2]=
//{9, 4,
//6, 8,
//2, 7};

Ipp64f pSrcA[4*8] =
{3, 3, 3, 3, 3, 8, 8, 8,
3, 2, 1, 2, 3, 8, 8, 8,
3, 2, 1, 2, 3, 8, 8, 8,
3, 3, 3, 3, 3, 8, 8, 8};

const int height=4;
const int width=8;
const int step=8;
int nIter=10;

Ipp64f pDstU[height*step];
Ipp64f pDstW[width];
Ipp64f pDstV[width*step];

IppStatus ret=ippsSVD_64f_D2(pSrcA,pDstU, height,pDstW, pDstV, width, step, nIter);

printf("n%d : %sn", ret, ippGetStatusString(ret));

printf("n the result in U n");
for ( int y = 0; y < height; y++ )
{printf("n");
for ( int x = 0; x < step; x++ )
printf("%3.2f ", pDstU[(y * step) + x]);
}

printf("nn the result in W n");
for ( int y = 0; y < width; y++ )
printf("%3.2f ", pDstW);

printf("nn the result in V n");
for ( int y = 0; y < width; y++ )
{
printf("n");
for ( int x = 0; x < step; x++ )
printf("%3.2f ", pDstV[(y * step) + x]);
}

return 0;
}

Regards,
Ying