Skip to content
Snippets Groups Projects
Commit a5ff64a7 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

BUG FIX: reshape C1 common rc field to configuration numer

parent fa2439a9
Branches
Tags
No related merge requests found
......@@ -31,15 +31,23 @@ C1::C1(int ns, int l_max, int *_nshl, int *_iog) {
}
w = new complex<double>*[nlmmt];
for (int wi = 0; wi < nlmmt; wi++) w[wi] = new complex<double>[4]();
int configurations = 0;
for (int ci = 1; ci <= nsph; ci++) {
if (_iog[ci - 1] >= ci) configurations++;
}
vints = new complex<double>*[nsph];
rc = new double*[nsph];
nshl = new int[nsph]();
rc = new double*[configurations];
nshl = new int[configurations]();
iog = new int[nsph]();
int conf_index = 0;
for (int vi = 0; vi < nsph; vi++) {
rc[vi] = new double[_nshl[vi]]();
vints[vi] = new complex<double>[16]();
nshl[vi] = _nshl[vi];
iog[vi] = _iog[vi];
if (iog[vi] >= vi + 1) {
nshl[conf_index] = _nshl[conf_index];
rc[conf_index] = new double[_nshl[conf_index]]();
conf_index++;
}
}
fsas = new complex<double>[nsph]();
sscs = new double[nsph]();
......@@ -66,11 +74,17 @@ C1::~C1() {
delete[] rmi;
delete[] rei;
for (int wi = nlmmt - 1; wi > -1; wi--) delete[] w[wi];
int conf_index = 0;
for (int ci = 1; ci <= nsph; ci++) {
if (iog[ci] >= ci) {
delete[] rc[conf_index];
conf_index++;
}
}
delete[] rc;
for (int vi = nsph - 1; vi > - 1; vi--) {
delete[] rc[vi];
delete[] vints[vi];
}
delete[] rc;
delete[] vints;
for (int si = nsph - 1; si > -1; si--) {
delete[] sas[si][1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment