diff --git a/src/fourier/fft/fftw_complex.hpp b/src/fourier/fft/fftw_complex.hpp new file mode 100644 index 0000000..af5d445 --- /dev/null +++ b/src/fourier/fft/fftw_complex.hpp @@ -0,0 +1,42 @@ +#ifndef __COSMOTOOL_FFT_COMPLEX_HPP +#define __COSMOTOOL_FFT_COMPLEX_HPP + +#include +#include + +namespace CosmoTool +{ + template + struct adapt_complex { + }; + + template<> struct adapt_complex { + typedef fftw_complex f_type; + typedef std::complex cpp_complex; + + static inline cpp_complex *adapt(f_type *a) { + return reinterpret_cast(a); + } + }; + + template<> struct adapt_complex { + typedef fftwf_complex f_type; + typedef std::complex cpp_complex; + + static inline cpp_complex *adapt(f_type *a) { + return reinterpret_cast(a); + } + }; + + template<> struct adapt_complex { + typedef fftwl_complex f_type; + typedef std::complex cpp_complex; + + static inline cpp_complex *adapt(f_type *a) { + return reinterpret_cast(a); + } + }; + +} + +#endif \ No newline at end of file