Commit f84e562d authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Initialize matrices and vectors at zero

parent 979015ad
Loading
Loading
Loading
Loading
+16 −16
Original line number Original line Diff line number Diff line
@@ -98,31 +98,31 @@ C1_AddOns::C1_AddOns(C4 *c4) {
	lmpo = c4->lmpo;
	lmpo = c4->lmpo;
	nlemt = 2 * c4->nlem;
	nlemt = 2 * c4->nlem;
	vh = new complex<double>[(nsph * nsph - 1) * c4->litpo]();
	vh = new complex<double>[(nsph * nsph - 1) * c4->litpo]();
	vj0 = new complex<double>[nsph * c4->lmtpo];
	vj0 = new complex<double>[nsph * c4->lmtpo]();
	vj = new complex<double>[1]; // QUESTION: is 1 really enough for a general case?
	vj = new complex<double>[1](); // QUESTION: is 1 really enough for a general case?
	vyhj = new complex<double>[(nsph * nsph - 1) * c4->litpos];
	vyhj = new complex<double>[(nsph * nsph - 1) * c4->litpos]();
	vyj0 = new complex<double>[nsph * c4->lmtpos];
	vyj0 = new complex<double>[nsph * c4->lmtpos]();
	am0m = new complex<double>*[nlemt];
	am0m = new complex<double>*[nlemt];
	for (int ai = 0; ai < nlemt; ai++) {
	for (int ai = 0; ai < nlemt; ai++) {
		am0m[ai] = new complex<double>[nlemt];
		am0m[ai] = new complex<double>[nlemt]();
	}
	}
	vint = new complex<double>[16];
	vint = new complex<double>[16]();
	vintm = new complex<double>[16];
	vintm = new complex<double>[16]();
	vintt = new complex<double>[16];
	vintt = new complex<double>[16]();
	fsac = new complex<double>*[2];
	fsac = new complex<double>*[2];
	sac = new complex<double>*[2];
	sac = new complex<double>*[2];
	fsacm = new complex<double>*[2];
	fsacm = new complex<double>*[2];
	for (int fi = 0; fi < 2; fi++) {
	for (int fi = 0; fi < 2; fi++) {
		fsac[fi] = new complex<double>[2];
		fsac[fi] = new complex<double>[2]();
		sac[fi] = new complex<double>[2];
		sac[fi] = new complex<double>[2]();
		fsacm[fi] = new complex<double>[2];
		fsacm[fi] = new complex<double>[2]();
	}
	}
	scscp = new complex<double>[2];
	scscp = new complex<double>[2]();
	ecscp = new complex<double>[2];
	ecscp = new complex<double>[2]();
	scscpm = new complex<double>[2];
	scscpm = new complex<double>[2]();
	ecscpm = new complex<double>[2];
	ecscpm = new complex<double>[2]();
	allocate_vectors(c4);
	allocate_vectors(c4);
	sscs = new double[nsph];
	sscs = new double[nsph]();
}
}


C1_AddOns::~C1_AddOns() {
C1_AddOns::~C1_AddOns() {