A Description problem of matrix

A Description problem of matrix

Hi:
I use ipp lib to do matrix operation in Visual C++ 6.0, but there is a parameter making me confused, for example, I use "ippmInvert_m_64f_5x5" then I need to enter the parameter "srcStride".
Is "srcStride" eaqual 5 ? or other intger?
can you give me an guide?
please adviser
thank you so much~

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi, did you looked through IPP manual? I believe the concept of matrix in IPP is described here.

Regards,
Vladimir

BTW, developer provided simple sample for you, which should demonstrate the way of using this function

Code:

#include 
#include 

IppStatus ippmInvert_m_64f_5x5 (const Ipp64f* pSrc, Ipp32s srcStride1, Ipp64f*
                                pDst, Ipp32s dstStride1)
{
    Ipp64f pBuffer[5*5+5]; /* Buffer location */

    return ippmInvert_m_64f(pSrc, srcStride1, sizeof(Ipp64f), pBuffer, 
        pDst, dstStride1, sizeof(Ipp64f), 5); 
}

void printf_m_Ipp64f(const char* msg, Ipp64f* buf, 
                     int width, int height, IppStatus st ); 

/* 
// Example demonstrates how to use the function iinvert_m_64f_5x5
//
// Standard description for source and destination matrices      
*/
int main(){
    int widthHeight = 5;
   /* Source matrix with widthHeight=5 */
    Ipp64f pSrc[5*5] = { 1,  1, -1,  1, -1,
                        -1,  0,  2, -1,  1,
                        -1, -1,  2,  0, -1,
                         1, -1,  0,  1, -1,
                        -1, -1,  2,  1, -1};
    int srcStride1  = 5*sizeof(Ipp64f);

   /* Destination matrix with widthHeight=5 */
    Ipp64f pDst[5*5];
    int dstStride1 = 5*sizeof(Ipp64f);

     IppStatus status = ippmInvert_m_64f_5x5 (pSrc, srcStride1, pDst, dstStride1);

     printf_m_Ipp64f("Destination matrix:", pDst, 5, 5, status);
     return status;
}

void printf_m_Ipp64f(const char* msg, Ipp64f* buf, 
                     int width, int height, IppStatus st ) 
{   int i, j;
    if( st < ippStsNoErr ) { 
        printf( "-- error %d, %s
", st, ippGetStatusString( st )); 
    } else { 
        printf("%s 
", msg ); 
        for( j=0; j <  height; j++) { 
		    for( i=0; i < width; i++) { 
	            printf("%f  ", buf[j*width+i]); } 
		    printf("
"); } } 
}

Regards,
Vladimir

Leave a Comment

Please sign in to add a comment. Not a member? Join today