diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-03 11:02:53 -0300 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-03 11:02:53 -0300 |
commit | 8f22dcbf56c7cbf5f37b3790d855c3622ed46fe5 (patch) | |
tree | 1a67b403792300c417f9b21ddce238b73ea3c1a0 | |
parent | e111cad0f953860e0d94d6e5d6901a6212473307 (diff) | |
download | code-8f22dcbf56c7cbf5f37b3790d855c3622ed46fe5.tar.gz code-8f22dcbf56c7cbf5f37b3790d855c3622ed46fe5.tar.bz2 code-8f22dcbf56c7cbf5f37b3790d855c3622ed46fe5.zip |
Added FFTW estimate flage to get_energy for speed
-rw-r--r-- | get_energy.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/get_energy.cpp b/get_energy.cpp index bb01095..449c2c6 100644 --- a/get_energy.cpp +++ b/get_energy.cpp @@ -43,9 +43,9 @@ private: Real Δω; Real Δτ; public: - FourierTransform(unsigned n, Real Δω, Real Δτ) : a(2 * n), â(n + 1), Δω(Δω), Δτ(Δτ) { - plan_r2c = fftw_plan_dft_r2c_1d(2 * n, a.data(), reinterpret_cast<fftw_complex*>(â.data()), 0); - plan_c2r = fftw_plan_dft_c2r_1d(2 * n, reinterpret_cast<fftw_complex*>(â.data()), a.data(), 0); + FourierTransform(unsigned n, Real Δω, Real Δτ, unsigned flags = 0) : a(2 * n), â(n + 1), Δω(Δω), Δτ(Δτ) { + plan_r2c = fftw_plan_dft_r2c_1d(2 * n, a.data(), reinterpret_cast<fftw_complex*>(â.data()), flags); + plan_c2r = fftw_plan_dft_c2r_1d(2 * n, reinterpret_cast<fftw_complex*>(â.data()), a.data(), flags); } ~FourierTransform() { @@ -127,7 +127,7 @@ int main(int argc, char* argv[]) { Real y = y₀; - FourierTransform fft(n, Δω, Δτ); + FourierTransform fft(n, Δω, Δτ, FFTW_ESTIMATE); while (y += Δy, y <= yₘₐₓ) { std::vector<Real> C(2 * n); |