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
No related branches found
No related tags found
No related merge requests found
...@@ -31,15 +31,23 @@ C1::C1(int ns, int l_max, int *_nshl, int *_iog) { ...@@ -31,15 +31,23 @@ C1::C1(int ns, int l_max, int *_nshl, int *_iog) {
} }
w = new complex<double>*[nlmmt]; w = new complex<double>*[nlmmt];
for (int wi = 0; wi < nlmmt; wi++) w[wi] = new complex<double>[4](); 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]; vints = new complex<double>*[nsph];
rc = new double*[nsph]; rc = new double*[configurations];
nshl = new int[nsph](); nshl = new int[configurations]();
iog = new int[nsph](); iog = new int[nsph]();
int conf_index = 0;
for (int vi = 0; vi < nsph; vi++) { for (int vi = 0; vi < nsph; vi++) {
rc[vi] = new double[_nshl[vi]]();
vints[vi] = new complex<double>[16](); vints[vi] = new complex<double>[16]();
nshl[vi] = _nshl[vi];
iog[vi] = _iog[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](); fsas = new complex<double>[nsph]();
sscs = new double[nsph](); sscs = new double[nsph]();
...@@ -66,11 +74,17 @@ C1::~C1() { ...@@ -66,11 +74,17 @@ C1::~C1() {
delete[] rmi; delete[] rmi;
delete[] rei; delete[] rei;
for (int wi = nlmmt - 1; wi > -1; wi--) delete[] w[wi]; 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--) { for (int vi = nsph - 1; vi > - 1; vi--) {
delete[] rc[vi];
delete[] vints[vi]; delete[] vints[vi];
} }
delete[] rc;
delete[] vints; delete[] vints;
for (int si = nsph - 1; si > -1; si--) { for (int si = nsph - 1; si > -1; si--) {
delete[] sas[si][1]; 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