Skip to content

Commit c9d4603

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 8823630 commit c9d4603

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

source/module_hamilt_general/operator.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Operator<T, Device>::Operator(){}
1111
template<typename T, typename Device>
1212
Operator<T, Device>::~Operator()
1313
{
14-
if(this->hpsi != nullptr) delete this->hpsi;
14+
if(this->hpsi != nullptr) { delete this->hpsi;
15+
}
1516
Operator* last = this->next_op;
1617
Operator* last_sub = this->next_sub_op;
1718
while(last != nullptr || last_sub != nullptr)
@@ -100,9 +101,11 @@ void Operator<T, Device>::init(const int ik_in)
100101
template<typename T, typename Device>
101102
void Operator<T, Device>::add(Operator* next)
102103
{
103-
if(next==nullptr) return;
104+
if(next==nullptr) { return;
105+
}
104106
next->is_first_node = false;
105-
if(next->next_op != nullptr) this->add(next->next_op);
107+
if(next->next_op != nullptr) { this->add(next->next_op);
108+
}
106109
Operator* last = this;
107110
//loop to end of the chain
108111
while(last->next_op != nullptr)

source/module_hsolver/diago_iter_assist.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ void DiagoIterAssist<T, Device>::diagH_subspace_init(hamilt::Hamilt<T, Device>*
212212
{
213213
// psi_temp is one band psi, psi is all bands psi, the range always is 1 for the only band in psi_temp
214214
syncmem_complex_op()(ctx, ctx, ppsi, psi + i * psi_nc, psi_nc);
215-
psi::Range band_by_band_range(1, 0, 0, 0);
215+
psi::Range band_by_band_range(true, 0, 0, 0);
216216
hpsi_info hpsi_in(&psi_temp, band_by_band_range, hpsi);
217217

218218
// H|Psi> to get hpsi for target band
@@ -256,7 +256,7 @@ void DiagoIterAssist<T, Device>::diagH_subspace_init(hamilt::Hamilt<T, Device>*
256256

257257
T* hpsi = temp;
258258
// do hPsi for all bands
259-
psi::Range all_bands_range(1, 0, 0, nstart - 1);
259+
psi::Range all_bands_range(true, 0, 0, nstart - 1);
260260
hpsi_info hpsi_in(&psi_temp, all_bands_range, hpsi);
261261
pHamilt->ops->hPsi(hpsi_in);
262262

@@ -586,8 +586,9 @@ bool DiagoIterAssist<T, Device>::test_exit_cond(const int& ntry, const int& notc
586586
//================================================================
587587

588588
bool scf = true;
589-
if (PARAM.inp.calculation == "nscf")
589+
if (PARAM.inp.calculation == "nscf") {
590590
scf = false;
591+
}
591592

592593
// If ntry <=5, try to do it better, if ntry > 5, exit.
593594
const bool f1 = (ntry <= 5);

0 commit comments

Comments
 (0)