Skip to content

Commit 5a86f45

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent c2cb0df commit 5a86f45

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

source/module_lr/hamilt_casida.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ namespace LR
1212
const int ldim = nk * px.get_local_size();
1313
int npairs = no * nv;
1414
std::vector<T> Amat_full(this->nk * npairs * this->nk * npairs, 0.0);
15-
for (int ik = 0;ik < this->nk;++ik)
16-
for (int j = 0;j < no;++j)
15+
for (int ik = 0;ik < this->nk;++ik) {
16+
for (int j = 0;j < no;++j) {
1717
for (int b = 0;b < nv;++b)
1818
{//calculate A^{ai} for each bj
1919
int bj = j * nv + b; //global
@@ -41,12 +41,15 @@ namespace LR
4141
// reduce ai for a fixed bj
4242
A_aibj.fix_kb(0, 0);
4343
#ifdef __MPI
44-
for (int ik_ai = 0;ik_ai < this->nk;++ik_ai)
44+
for (int ik_ai = 0;ik_ai < this->nk;++ik_ai) {
4545
LR_Util::gather_2d_to_full(px, &A_aibj.get_pointer()[ik_ai * px.get_local_size()],
4646
Amat_full.data() + kbj * this->nk * npairs /*col, bj*/ + ik_ai * npairs/*row, ai*/,
4747
false, nv, no);
48+
}
4849
#endif
4950
}
51+
}
52+
}
5053
// output Amat
5154
std::cout << "Full A matrix: (elements < 1e-10 is set to 0)" << std::endl;
5255
LR_Util::print_value(Amat_full.data(), nk * npairs, nk * npairs);

0 commit comments

Comments
 (0)