Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

zgesvd difference from MATLAB

haintz
Beginner
255 Views
I using zgesvd on a 16x16 complex matrix.

#define N = 16
MKL_Complex16 vt[N*N];
char jobu = 'A';
char jobvt = 'A';
int m = N;
int n = N;
int ldR = N;
double s;
MKL_Complex16 u[N*N];
int ldu = N;
MKL_Complex16 vt[N*N];
int ldvt = N;
int lwork = 2048;
MKL_Complex16 *work;
work = new MKL_Complex16[2048];
MKL_Complex16 R[N*N];
double rwork[100];
int iwork[100];
int info;

zgesvd(&jobu, &jobvt, &m, &n, R, &ldR, s, u, &ldu, vt, &ldvt, work, &lwork, rwork, &info);

When I compare the result to Matlab the 2 columns of vt are the same as the Matlab output and 2 rows of u are the same as the Matlab output. Also, I only get the first 2 eigenvalues correct from Intel MKL.

Am I calling zgesvd correctly?

I am using C++ in Visual Studio 2005.

Thanks,
Pavel




0 Kudos
0 Replies
Reply