From e4ab12ce914b2471355a99943b58c5b274d8754c Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 18 Apr 2025 23:02:43 -0300 Subject: Refactor --- fourier.hpp | 39 ++------------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) (limited to 'fourier.hpp') diff --git a/fourier.hpp b/fourier.hpp index 1708667..6be0931 100644 --- a/fourier.hpp +++ b/fourier.hpp @@ -1,23 +1,15 @@ #pragma once +#include "types.hpp" + #include #include -#include #include #include -#include #ifndef FFTW_THREADS #define FFTW_THREADS 1 #endif -using Real = double; -using Complex = std::complex; -using namespace std::complex_literals; - -Real f(Real λ, unsigned p, unsigned s, Real q); -Real df(Real λ, unsigned p, unsigned s, Real q); -Real ddf(Real λ, unsigned p, unsigned s, Real q); - class FourierTransform { private: Real* a; @@ -37,33 +29,6 @@ public: std::vector convolve(const std::vector& Γh, const std::vector& R); }; -class LogarithmicFourierTransform { -private: - Complex* a; - Complex* â; - fftw_plan a_to_â; - fftw_plan â_to_a; - unsigned N; - unsigned pad; - Real k; - Real Δτ; - Real τₛ; - Real ωₛ; - Real sₛ; -public: - LogarithmicFourierTransform(unsigned N, Real k, Real Δτ, unsigned pad = 4); - ~LogarithmicFourierTransform(); - Real τ(unsigned n) const; - Real ω(unsigned n) const; - Real t(unsigned n) const; - Real ν(unsigned n) const; - Real s(unsigned n) const; - std::vector fourier(const std::vector& c, bool symmetric); - std::vector inverse(const std::vector& ĉ); -}; - -Complex gamma(Complex z); - std::string fourierFile(std::string prefix, unsigned p, unsigned s, Real λ, Real τ₀, Real y, unsigned log2n, Real τₘₐₓ); Real energy(const std::vector& C, const std::vector& R, unsigned p, unsigned s, Real λ, Real y, Real Δτ); std::tuple, std::vector> RddfCtdfCt(FourierTransform& fft, const std::vector& C, const std::vector& R, unsigned p, unsigned s, Real λ); -- cgit v1.2.3-70-g09d2