Dear all,

I am writing code to process mat multiply. And I write a little program to test the result of zgemm. But the result is incorrect and I do not really know the reason. I write code on my labtop. -i7 64bit windows8 visual studio 2010 mkl 10.0.3.021

Here is the code. The size of A is 3*2 and the size of B is 2*2 which is a unit matrix. I think the result is A itself but it seems not.

int main()

{

int *m =new int; //m*n n*k

int *n =new int;

int *k =new int;

*m =3;

*n = 2;

*k = 2;

MKL_Complex16 *A = new MKL_Complex16 [6];

MKL_Complex16 *B = new MKL_Complex16 [4];

MKL_Complex16 *N = new MKL_Complex16 [4];

A[0].real = 1;

A[1].real = 2;

A[2].real = 3;

A[3].real = 4;

A[4].real = 5;

A[5].real = 6;

for(int i=0; i<6; i++) A[i].imag =0;

B[0].real = 1;

B[1].real = 0;

A[2].real = 0;

A[3].real = 1;

for(int i=0; i<4; i++) B[i].imag =0;

MKL_Complex16 *alpha = new MKL_Complex16;

MKL_Complex16 *beta = new MKL_Complex16;

MKL_Complex16 cAlpha = {1,0}, cBeta = {0,0};

alpha = &cAlpha;

beta = &cBeta;

zgemm("n","n",m,k,n,alpha,A,m,B,n,beta,N,m);

for(int i=0;i<6;i++) std::cout<<(N+i)<<" "<<N[i].real<<" "<<N[i].imag<<std::endl;

getchar();

return 0;

}

I do not know whether I output the result in a right way. I really need help. Thank all of you a lot!!

Claire