From b1b15f0b705014dbcec543b41b3b8690e17176b5 Mon Sep 17 00:00:00 2001 From: Chulwoo Jung Date: Mon, 5 Jun 2017 23:13:41 -0400 Subject: [PATCH] Further fixes from multidimensional array --- .../iterative/ImplicitlyRestartedLanczos.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h b/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h index 7cbcbd64..8cafeb94 100644 --- a/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h +++ b/lib/algorithms/iterative/ImplicitlyRestartedLanczos.h @@ -297,11 +297,15 @@ public: if (j==(i-1)) EE[j] = lme[j]; } LAPACK_INT evals_found; - LAPACK_INT lwork = ( (18*NN) > (1+4*NN+NN*NN)? (18*NN):(1+4*NN+NN*NN)) ; +// LAPACK_INT lwork = ( (18*NN) > (1+4*NN+NN*NN)? (18*NN):(1+4*NN+NN*NN)) ; + LAPACK_INT lwork = 1+(18*NN) ; LAPACK_INT liwork = 3+NN*10 ; - LAPACK_INT iwork[liwork]; - double work[lwork]; - LAPACK_INT isuppz[2*NN]; +// LAPACK_INT iwork[liwork]; +// double work[lwork]; +// LAPACK_INT isuppz[2*NN]; + std::vector iwork(liwork); + std::vector work(lwork); + std::vector isuppz(2*NN); char jobz = 'V'; // calculate evals & evecs char range = 'I'; // calculate all evals // char range = 'A'; // calculate all evals @@ -332,8 +336,8 @@ public: &vl, &vu, &il, &iu, // these four are ignored if second parameteris 'A' &tol, // tolerance &evals_found, evals_tmp.data(), evec_tmp.data(), &NN, - isuppz, - work, &lwork, iwork, &liwork, + isuppz.data(), + work.data(), &lwork, iwork.data(), &liwork, &info); for (int i = iu-1; i>= il-1; i--){ printf("node=%d evals_found=%d evals_tmp[%d] = %g\n",node,evals_found, i - (il-1),evals_tmp[i - (il-1)]);