Skip to content
Snippets Groups Projects
Commit 4411b559 authored by Beerwerth, Randolf's avatar Beerwerth, Randolf
Browse files

use exp_I(x) instead of exp(I * x)

parent a8194279
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@ complex_t FormFactorTruncatedSpheroid::Integrand(double Z) const
complex_t qrRz = std::sqrt(m_q.x() * m_q.x() + m_q.y() * m_q.y()) * Rz;
complex_t J1_qrRz_div_qrRz = MathFunctions::Bessel_J1c(qrRz);
return Rz * Rz * J1_qrRz_div_qrRz * std::exp(I * m_q.z() * Z);
return Rz * Rz * J1_qrRz_div_qrRz * exp_I(m_q.z() * Z);
}
complex_t FormFactorTruncatedSpheroid::evaluate_for_q(cvector_t q) const
......@@ -82,7 +82,7 @@ complex_t FormFactorTruncatedSpheroid::evaluate_for_q(cvector_t q) const
if (std::abs(m_q.mag()) <= std::numeric_limits<double>::epsilon())
return M_PI / 3. / fp * (H * H * (3. * R - H / fp) - m_dh * m_dh * (3. * R - m_dh / fp));
complex_t z_part = std::exp(I * m_q.z() * (H - fp * R));
complex_t z_part = exp_I(m_q.z() * (H - fp * R));
return M_TWOPI * z_part
* ComplexIntegrator().integrate([&](double Z) { return Integrand(Z); }, fp * R - H,
fp * R - m_dh);
......
......@@ -60,13 +60,13 @@ complex_t ripples::profile_yz_cosine(complex_t qy, complex_t qz, double width, d
// numerical integration otherwise
const complex_t ay = qy * width / M_TWOPI;
const complex_t az = I * qz * (height / 2);
const complex_t az = qz * (height / 2);
const auto integrand = [&](double u) -> complex_t {
return sin(u) * exp(az * std::cos(u)) * (ay == 0. ? u : sin(ay * u) / ay);
return sin(u) * exp_I(az * std::cos(u)) * (ay == 0. ? u : sin(ay * u) / ay);
};
complex_t integral = ComplexIntegrator().integrate(integrand, 0, M_PI);
return factor * integral * exp(az) * (height / 2);
return factor * integral * exp_I(az) * (height / 2);
}
//! Complex form factor of triangular ripple.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment