diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-30 11:23:38 -0300 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-30 11:23:38 -0300 |
commit | 947daeb85321ed804bc3142623844b2617cb1b3e (patch) | |
tree | 5e91dfa3bf674210854d9402714f2ae1b909f3c9 /log-fourier_integrator.cpp | |
parent | d422676a24bc3967ab3f319d60f7798081dab4e5 (diff) | |
download | code-947daeb85321ed804bc3142623844b2617cb1b3e.tar.gz code-947daeb85321ed804bc3142623844b2617cb1b3e.tar.bz2 code-947daeb85321ed804bc3142623844b2617cb1b3e.zip |
Support long double in the integrator
Diffstat (limited to 'log-fourier_integrator.cpp')
-rw-r--r-- | log-fourier_integrator.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/log-fourier_integrator.cpp b/log-fourier_integrator.cpp index 9bbf554..7ac76b5 100644 --- a/log-fourier_integrator.cpp +++ b/log-fourier_integrator.cpp @@ -79,7 +79,7 @@ int main(int argc, char* argv[]) { LogarithmicFourierTransform fft(N, k, Δτ, 4); - Real Γ₀ = 1.0; + Real Γ₀ = 1; Real μₜ₋₁ = Γ₀; if (τ₀ > 0) { μₜ₋₁ = (sqrt(1+4*Γ₀*τ₀)-1)/(2*τ₀); @@ -105,7 +105,7 @@ int main(int argc, char* argv[]) { Rₜ₋₁[n] = exp(-μₜ₋₁ * fft.t(n)); Ĉₜ₋₁[n] = 2 * Γ₀ / (pow(μₜ₋₁, 2) + pow(fft.ν(n), 2)) / (1 + pow(τ₀ * fft.ν(n), 2)); - Ȓₜ₋₁[n] = 1.0 / (μₜ₋₁ + 1i * fft.ν(n)); + Ȓₜ₋₁[n] = (Real)1.0 / (μₜ₋₁ + II * fft.ν(n)); } } else { logFourierLoad(Cₜ₋₁, Rₜ₋₁, Ĉₜ₋₁, Ȓₜ₋₁, p, s, λ, τ₀, β₀, log2n, Δτ, k); @@ -130,8 +130,8 @@ int main(int argc, char* argv[]) { std::vector<Complex> Ĉₜ₊₁(N); std::vector<Complex> Ȓₜ₊₁(N); for (unsigned n = 0; n < N; n++) { - Ȓₜ₊₁[n] = (1.0 + pow(β, 2) * RddfCt[n] * Ȓₜ[n]) / (μₜ + 1i * fft.ν(n)); - Ĉₜ₊₁[n] = (2 * Γ₀ * std::conj(Ȓₜ[n]) / (1 + pow(τ₀ * fft.ν(n), 2)) + pow(β, 2) * (RddfCt[n] * Ĉₜ[n] + dfCt[n] * std::conj(Ȓₜ[n]))) / (μₜ + 1i * fft.ν(n)); + Ȓₜ₊₁[n] = ((Real)1.0 + std::pow(β, 2) * RddfCt[n] * Ȓₜ[n]) / (μₜ + II * fft.ν(n)); + Ĉₜ₊₁[n] = (2 * Γ₀ * std::conj(Ȓₜ[n]) / (1 + std::pow(τ₀ * fft.ν(n), 2)) + std::pow(β, 2) * (RddfCt[n] * Ĉₜ[n] + dfCt[n] * std::conj(Ȓₜ[n]))) / (μₜ + II * fft.ν(n)); } std::vector<Real> Rₜ₊₁ = fft.inverse(Ȓₜ₊₁); std::vector<Real> Cₜ₊₁ = fft.inverse(Ĉₜ₊₁); @@ -153,7 +153,7 @@ int main(int argc, char* argv[]) { } if (stepsUp > stepsToRespond) { - γ = std::max(γ/2, 1e-4); + γ = std::max(γ/2, (Real)1e-4); stepsUp = 0; ΔCmin = ΔCₜ; } |