@@ -26,15 +26,21 @@ void DiagoBlas::diag(hamilt::Hamilt *phm_in, psi::Psi<double> &psi, double *eige
2626 matd h_mat, s_mat;
2727 phm_in->matrix (h_mat, s_mat);
2828 assert (h_mat.col == s_mat.col && h_mat.row == s_mat.row && h_mat.desc == s_mat.desc );
29- this ->pdsygvx_diag (h_mat.desc , h_mat.col , h_mat.row , h_mat.p , s_mat.p , eigenvalue_in, psi);
29+ std::vector<double > eigen (GlobalV::NLOCAL, 0.0 );
30+ this ->pdsygvx_diag (h_mat.desc , h_mat.col , h_mat.row , h_mat.p , s_mat.p , eigen.data (), psi);
31+ const int inc = 1 ;
32+ BlasConnector::copy (GlobalV::NBANDS, eigen.data (), inc, eigenvalue_in, inc);
3033}
3134
3235void DiagoBlas::diag (hamilt::Hamilt *phm_in, psi::Psi<std::complex <double >> &psi, double *eigenvalue_in)
3336{
3437 matcd h_mat, s_mat;
3538 phm_in->matrix (h_mat, s_mat);
3639 assert (h_mat.col == s_mat.col && h_mat.row == s_mat.row && h_mat.desc == s_mat.desc );
37- this ->pzhegvx_diag (h_mat.desc , h_mat.col , h_mat.row , h_mat.p , s_mat.p , eigenvalue_in, psi);
40+ std::vector<double > eigen (GlobalV::NLOCAL, 0.0 );
41+ this ->pzhegvx_diag (h_mat.desc , h_mat.col , h_mat.row , h_mat.p , s_mat.p , eigen.data (), psi);
42+ const int inc = 1 ;
43+ BlasConnector::copy (GlobalV::NBANDS, eigen.data (), inc, eigenvalue_in, inc);
3844}
3945
4046std::pair<int , std::vector<int >> DiagoBlas::pdsygvx_once (const int *const desc,
0 commit comments