zgeev question

Open discussion regarding features, bugs, issues, vendors, etc.

zgeev question

Postby ealtmix » Wed May 23, 2012 12:28 pm

Code: Select all
lapack_int info, lda, m, n;
lapack_complex_double* h;
lapack_complex_double * w,* vr,* vl;
h = calloc(16*16,sizeof(lapack_complex_float));
vr = calloc(16*16, sizeof(lapack_complex_double));
vl = calloc(16*16, sizeof(lapack_complex_double));
w = calloc(16, sizeof(lapack_complex_double));
m = 16;
n = 16;
lda = 16;

bunch of voodoo that fills h to be a 16x16 matrix with skewed symmetry

info = LAPACKE_zgeev(LAPACK_ROW_MAJOR,'N','V', n, h, m, w, vl, lda, vr, lda); //find bug

Anytime I run this code I receive:

*** glibc detected *** ./test2: free(): invalid next size (normal): 0x0812b010 ***
+ a backtrace and a memory map

I'm almost positive that you have to preallocate things such as w, vl, and vr as anytime I comment that part out I get a seg-fault. I ran it with zgeev_work, and it would work so long as lwork = -1, anything else and I would receive the same error, but I would receive an output of everything being 0, which isn't true, so I've botched something.

Thanks in advanced, and sorry if I've left out something obvious/crucial

PS: completely new to LAPACK
Posts: 1
Joined: Wed May 23, 2012 12:11 pm

Re: zgeev question

Postby admin » Wed May 23, 2012 8:59 pm

Code: Select all
h = calloc(16*16,sizeof(lapack_complex_float));

is wrong, this should be lapack_complex_double

You can look at the INTEL examples for LAPACKE if you need further help.
Just need to change the include to lapacke.h, the int type to lapack_int and some complex initialization depending on the complex types you are using.
Hope it helps
Site Admin
Posts: 616
Joined: Wed Dec 08, 2004 7:07 pm

Return to User Discussion

Who is online

Users browsing this forum: No registered users and 5 guests