From 516a9832d1f237396211a4806925d81e64ba7b14 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 9 May 2025 11:59:52 -0300 Subject: Undid energy tweaks, and restored mirror padding --- log-fourier.cpp | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'log-fourier.cpp') diff --git a/log-fourier.cpp b/log-fourier.cpp index 11edfcb..5d0da17 100644 --- a/log-fourier.cpp +++ b/log-fourier.cpp @@ -64,6 +64,8 @@ std::vector LogarithmicFourierTransform::fourier(const std::vector= (pad - 1) * N) { + a[n] = c[pad*N-n-1] * exp((1 - k) * τ(pad*N-n-1)); } else { a[n] = 0; } @@ -92,6 +94,8 @@ std::vector LogarithmicFourierTransform::inverse(const std::vector= (pad - 1) * N) { + a[n] = (ĉ[pad*N-n-1].real() + II * σ * ĉ[pad*N-n-1].imag()) * std::exp((1 - k) * ω(pad*N-n-1)); } else { a[n] = 0; } @@ -193,30 +197,6 @@ Real energy(const LogarithmicFourierTransform& fft, std::vector& C, const Real C₂ₙ₊₁ = C[2*n+1]; Real C₂ₙ₊₂ = C[2*n+2]; - if (R₂ₙ > 1 || R₂ₙ₊₁ > 1 || R₂ₙ₊₂ > 1) { - R₂ₙ = 1; - R₂ₙ₊₁ = 1; - R₂ₙ₊₂ = 1; - } - - if (C₂ₙ > 1 || C₂ₙ₊₁ > 1 || C₂ₙ₊₂ > 1) { - C₂ₙ = 1; - C₂ₙ₊₁ = 1; - C₂ₙ₊₂ = 1; - } - - if (R₂ₙ < 0 || R₂ₙ₊₁ < 0 || R₂ₙ₊₂ < 0) { - R₂ₙ = 0; - R₂ₙ₊₁ = 0; - R₂ₙ₊₂ = 0; - } - - if (C₂ₙ < 0 || C₂ₙ₊₁ < 0 || C₂ₙ₊₂ < 0) { - C₂ₙ = 0; - C₂ₙ₊₁ = 0; - C₂ₙ₊₂ = 0; - } - Real h₂ₙ = fft.t(2*n+1) - fft.t(2*n); Real h₂ₙ₊₁ = fft.t(2*n+2) - fft.t(2*n+1); Real f₂ₙ = R₂ₙ * df(λ, p, s, C₂ₙ); -- cgit v1.2.3-70-g09d2