int phonopy_zheev(double *w, lapack_complex_double *a, const int n, const char uplo) { lapack_int info; info = LAPACKE_zheev(LAPACK_ROW_MAJOR,'V', uplo, (lapack_int)n, a, (lapack_int)n, w); return (int)info; }
double diag(lapack_complex_double *mat, double *e, lapack_int n) { char jobz='V'; //also eigenvectors char uplo='U'; //upper triangle lapack_int info; /* The output vector matrix is always in col, just as in fortran, from smallest eigenvalue's vector to the largest.However, when you choose different matrix order, it means how the one dimension matrix collect the vector matrix. For COL_MAJOR, a[0],a[1],a[2],a[3] form the 1st eigenvector. For ROW_MAJOR,a[0],a[4],a[8],a[12] form an eigenvector */ info=LAPACKE_zheev(LAPACK_COL_MAJOR,jobz,uplo,n,mat,n,e); if(info!=0) { printf("matrix diag fail,the %d argument is wrong\n",info); exit(1); } }
template <> inline int heev(const char order, const char job, const char uplo, const int N, complex<double> *A, const int LDA, double *W) { return LAPACKE_zheev(order, job, uplo, N, A, LDA, W); }