@@ -25,9 +25,9 @@ Diago_DavSubspace<T, Device>::Diago_DavSubspace(const std::vector<Real>& precond
2525{
2626 this ->device = base_device::get_device_type<Device>(this ->ctx );
2727
28- this ->one = this -> cs . one ;
29- this ->zero = this -> cs . zero ;
30- this ->neg_one = this -> cs . neg_one ;
28+ this ->one = &one_ ;
29+ this ->zero = &zero_ ;
30+ this ->neg_one = &neg_one_ ;
3131
3232 assert (david_ndim_in > 1 );
3333 assert (david_ndim_in * nband_in < nbasis_in * this ->diag_comm .nproc );
@@ -559,8 +559,8 @@ void Diago_DavSubspace<T, Device>::diag_zhegvx(const int& nbase,
559559 }
560560 else
561561 {
562- std::vector<std::vector<T>> h_diag (nbase, std::vector<T>(nbase, cs. zero [ 0 ] ));
563- std::vector<std::vector<T>> s_diag (nbase, std::vector<T>(nbase, cs. zero [ 0 ] ));
562+ std::vector<std::vector<T>> h_diag (nbase, std::vector<T>(nbase, * this -> zero ));
563+ std::vector<std::vector<T>> s_diag (nbase, std::vector<T>(nbase, * this -> zero ));
564564
565565 for (size_t i = 0 ; i < nbase; i++)
566566 {
@@ -589,10 +589,10 @@ void Diago_DavSubspace<T, Device>::diag_zhegvx(const int& nbase,
589589
590590 for (size_t j = nbase; j < this ->nbase_x ; j++)
591591 {
592- hcc[i * this ->nbase_x + j] = cs. zero [ 0 ] ;
593- hcc[j * this ->nbase_x + i] = cs. zero [ 0 ] ;
594- scc[i * this ->nbase_x + j] = cs. zero [ 0 ] ;
595- scc[j * this ->nbase_x + i] = cs. zero [ 0 ] ;
592+ hcc[i * this ->nbase_x + j] = * this -> zero ;
593+ hcc[j * this ->nbase_x + i] = * this -> zero ;
594+ scc[i * this ->nbase_x + j] = * this -> zero ;
595+ scc[j * this ->nbase_x + i] = * this -> zero ;
596596 }
597597 }
598598 }
0 commit comments