Hi,
I want to do a complicated matrix product which is defined as
C[i,j] = \sum_{n,m} A[i,n]*A[j,n]* B[n,m] *A[i,m]*A[j,m]
Where A and B are two matrix with size of NxN, (N~1000).
To accomplish this task I just run four loops to creat the matrix C .
for(int i=0;i<ndim;i++)
for(int j=0;j<ndim;j++)
for(int n=0;n<ndim;n++)
for(int m=0;m<ndim;m++)
C[i,j] += A[i,n]*A[j,n]* B[n,m] *A[i,m]*A[j,m]
Can anyone suggest any better implementation using MKL matrix product function?
Thanks in advance.