mirror of
https://github.com/TREX-CoE/Sherman-Morrison.git
synced 2024-12-26 06:15:08 +01:00
Cleaned-up main loop.
This commit is contained in:
parent
066e50914c
commit
a9604b3838
@ -76,18 +76,18 @@ void MaponiA3(double *Slater_inv, unsigned int Dim,
|
|||||||
} tmp = p[l+1]; p[l+1] = p[lbar]; p[lbar] = tmp;
|
} tmp = p[l+1]; p[l+1] = p[lbar]; p[lbar] = tmp;
|
||||||
|
|
||||||
component = Updates_index[p[l+1] - 1];
|
component = Updates_index[p[l+1] - 1];
|
||||||
beta = 1 + ylk[l+1 - 1][p[l+1]][component];
|
beta = 1 + ylk[l][p[l+1]][component];
|
||||||
if (beta == 0) {
|
if (beta == 0) {
|
||||||
cout << "Break-down occured. Exiting..." << endl;
|
cout << "Break-down occured. Exiting..." << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
for (k = l+1 + 1; k < N_updates + 1; k++) {
|
for (k = l+2; k < N_updates + 1; k++) {
|
||||||
alpha = ylk[l+1 - 1][p[k]][component] / beta;
|
alpha = ylk[l][p[k]][component] / beta;
|
||||||
cout << "( l, k, p[k], component ) = (" << l << ", " << k << ", " << p[k] << ", " << component << ")" << endl;
|
cout << "( l, k, p[k], component ) = (" << l << ", " << k << ", " << p[k] << ", " << component << ")" << endl;
|
||||||
for (i = 1; i < Dim + 1; i++) {
|
for (i = 1; i < Dim + 1; i++) {
|
||||||
cout << "ylk[" << l << "][p[" << k << "]][" << i << "] = ylk[" << l - 1 << "][p[" << k << "]][" << i << "] - alpha * ylk[" << l - 1 << "][p[" << l << "]][" << i << "]" << endl;
|
cout << "ylk[" << l << "][p[" << k << "]][" << i << "] = ylk[" << l - 1 << "][p[" << k << "]][" << i << "] - alpha * ylk[" << l - 1 << "][p[" << l << "]][" << i << "]" << endl;
|
||||||
ylk[l+1][p[k]][i] = ylk[l+1 - 1][p[k]][i]
|
ylk[l+1][p[k]][i] = ylk[l][p[k]][i]
|
||||||
- alpha * ylk[l+1 - 1][p[l+1]][i];
|
- alpha * ylk[l][p[l+1]][i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user