ewald.c: type qualifiers

Former-commit-id: d1436642545f21bf3bf4a74f4365ece45b3a5c7d
This commit is contained in:
Marek Nečada 2018-09-15 18:32:49 +00:00
parent 169c091806
commit 68c1bf711a
1 changed files with 9 additions and 9 deletions

View File

@ -180,17 +180,17 @@ int ewald32_sigma_long_shiftedpoints (
// CHOOSE POINT BEGIN // CHOOSE POINT BEGIN
for (size_t i = 0; i < npoints; ++i) { // BEGIN POINT LOOP for (size_t i = 0; i < npoints; ++i) { // BEGIN POINT LOOP
point2d beta_pq = Kpoints_plus_beta[i]; const point2d beta_pq = Kpoints_plus_beta[i];
point2d K_pq = {beta_pq.x - beta.x, beta_pq.y - beta.y}; const point2d K_pq = {beta_pq.x - beta.x, beta_pq.y - beta.y};
double rbeta_pq = cart2norm(beta_pq); const double rbeta_pq = cart2norm(beta_pq);
// CHOOSE POINT END // CHOOSE POINT END
complex double phasefac = cexp(I*cart2_dot(K_pq,particle_shift)); // POINT-DEPENDENT (PFC) // !!!CHECKSIGN!!! const complex double phasefac = cexp(I*cart2_dot(K_pq,particle_shift)); // POINT-DEPENDENT (PFC) // !!!CHECKSIGN!!!
double arg_pq = atan2(beta_pq.y, beta_pq.x); // POINT-DEPENDENT const double arg_pq = atan2(beta_pq.y, beta_pq.x); // POINT-DEPENDENT
// R-DEPENDENT BEGIN // R-DEPENDENT BEGIN
complex double gamma_pq = lilgamma(rbeta_pq/k); const complex double gamma_pq = lilgamma(rbeta_pq/k);
complex double z = csq(gamma_pq*k/(2*eta)); // Když o tom tak přemýšlím, tak tohle je vlastně vždy reálné const complex double z = csq(gamma_pq*k/(2*eta)); // Když o tom tak přemýšlím, tak tohle je vlastně vždy reálné
for(qpms_l_t j = 0; j <= lMax/2; ++j) { for(qpms_l_t j = 0; j <= lMax/2; ++j) {
int retval = complex_gamma_inc_e(0.5-j, z, Gamma_pq+j); int retval = complex_gamma_inc_e(0.5-j, z, Gamma_pq+j);
// we take the other branch, cf. [Linton, p. 642 in the middle]: FIXME instead use the C11 CMPLX macros and fill in -O*I part to z in the line above // we take the other branch, cf. [Linton, p. 642 in the middle]: FIXME instead use the C11 CMPLX macros and fill in -O*I part to z in the line above
@ -206,8 +206,8 @@ int ewald32_sigma_long_shiftedpoints (
for(qpms_m_t m = -n; m <= n; ++m) { for(qpms_m_t m = -n; m <= n; ++m) {
if((m+n) % 2 != 0) // odd coefficients are zero. if((m+n) % 2 != 0) // odd coefficients are zero.
continue; continue;
qpms_y_t y = qpms_mn2y_sc(m, n); const qpms_y_t y = qpms_mn2y_sc(m, n);
complex double e_imalpha_pq = cexp(I*m*arg_pq); const complex double e_imalpha_pq = cexp(I*m*arg_pq);
complex double jsum, jsum_c; ckahaninit(&jsum, &jsum_c); complex double jsum, jsum_c; ckahaninit(&jsum, &jsum_c);
double jsum_err, jsum_err_c; kahaninit(&jsum_err, &jsum_err_c); // TODO do I really need to kahan sum errors? double jsum_err, jsum_err_c; kahaninit(&jsum_err, &jsum_err_c); // TODO do I really need to kahan sum errors?
assert((n-abs(m))/2 == c->s1_jMaxes[y]); assert((n-abs(m))/2 == c->s1_jMaxes[y]);