Hi everyone,
I'm trying to perform a vector multiply a matrix 3 times with in 0.1 ms in my controller application. The 3 matrices are 6*5, 6*7 and 2*7 separately. The current way I'm using is like the code below:
void Matrix_multiply(double *x, double *y, double *z,int m, int n)
{
int i,k;
for (i=0;i<m;i++)
{
*(z+i)=0
for(k=0;k<n;k++)
*(z+i)+= *(x+i*n+k)*(*(y+k));
}
return;
}
But the efficiency of the code is not high enough to be finished in 0.1ms. I tried to use the FPU DSP function:
void mpy_SP_RVxRV_2(float32 *y, const float32 *w, const float32 *x, const Uint16 N)
However since the requirement is N must be even so that it seems cannot be used. is there any way to optimize the code?
Thanks