- 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
Evan
PS: completely new to LAPACK

