Skip to content

Commit 3a0a50c

Browse files
committed
Fix 2
1 parent 541be8c commit 3a0a50c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

source/module_hsolver/diago_dav_subspace.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ 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 = &one_;
29+
this->zero = &zero_;
30+
this->neg_one = &neg_one_;
31+
2832
assert(david_ndim_in > 1);
2933
assert(david_ndim_in * nband_in < nbasis_in * this->diag_comm.nproc);
3034

@@ -193,7 +197,7 @@ int Diago_DavSubspace<T, Device>::diag_once(const HPsiFunc& hpsi_func,
193197
this->dim,
194198
this->vcc,
195199
this->nbase_x,
196-
*this->zero,
200+
this->zero,
197201
psi_in,
198202
psi_in_dmax);
199203

@@ -279,7 +283,7 @@ void Diago_DavSubspace<T, Device>::cal_grad(const HPsiFunc& hpsi_func,
279283
this->dim,
280284
vcc,
281285
this->nbase_x,
282-
*this->zero,
286+
this->zero,
283287
psi_iter + (nbase) * this->dim,
284288
this->dim);
285289

@@ -413,7 +417,7 @@ void Diago_DavSubspace<T, Device>::cal_elem(const int& dim,
413417
this->dim,
414418
&hphi[nbase * this->dim],
415419
this->dim,
416-
*this->zero,
420+
this->zero,
417421
&hcc[nbase * this->nbase_x],
418422
this->nbase_x);
419423

@@ -433,7 +437,7 @@ void Diago_DavSubspace<T, Device>::cal_elem(const int& dim,
433437
this->dim,
434438
psi_iter + nbase * this->dim,
435439
this->dim,
436-
*this->zero,
440+
this->zero,
437441
&scc[nbase * this->nbase_x],
438442
this->nbase_x);
439443

@@ -640,7 +644,7 @@ void Diago_DavSubspace<T, Device>::refresh(const int& dim,
640644
this->dim,
641645
this->vcc,
642646
this->nbase_x,
643-
*this->zero,
647+
this->zero,
644648
psi_iter + nband * this->dim,
645649
this->dim);
646650

0 commit comments

Comments
 (0)