diff --git a/bench/benchFFT.cpp b/bench/benchFFT.cpp index 84cc49fe3..ffa4ffffc 100644 --- a/bench/benchFFT.cpp +++ b/bench/benchFFT.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include using namespace Eigen; using namespace std; diff --git a/unsupported/Eigen/FFT.h b/unsupported/Eigen/FFT similarity index 86% rename from unsupported/Eigen/FFT.h rename to unsupported/Eigen/FFT index c466423b7..3d852f5a2 100644 --- a/unsupported/Eigen/FFT.h +++ b/unsupported/Eigen/FFT @@ -25,28 +25,28 @@ #ifndef EIGEN_FFT_H #define EIGEN_FFT_H -// simple_fft_traits: small, free, reasonably efficient default, derived from kissfft -#include "src/FFT/simple_fft_traits.h" -#define DEFAULT_FFT_TRAITS simple_fft_traits +// ei_kissfft_impl: small, free, reasonably efficient default, derived from kissfft +#include "src/FFT/ei_kissfft_impl.h" +#define DEFAULT_FFT_IMPL ei_kissfft_impl // FFTW: faster, GPL-not LGPL, bigger code size #ifdef FFTW_PATIENT // definition of FFTW_PATIENT indicates the caller has included fftw3.h, we can use FFTW routines // TODO -// #include "src/FFT/fftw_traits.h" -// #define DEFAULT_FFT_TRAITS fftw_traits +// #include "src/FFT/ei_fftw_impl.h" +// #define DEFAULT_FFT_IMPL ei_fftw_impl #endif // intel Math Kernel Library: fastest, commerical #ifdef _MKL_DFTI_H_ // mkl_dfti.h has been included, we can use MKL FFT routines // TODO -// #include "src/FFT/imkl_traits.h" -// #define DEFAULT_FFT_TRAITS imkl_traits +// #include "src/FFT/ei_imkl_impl.h" +// #define DEFAULT_FFT_IMPL ei_imkl_impl #endif namespace Eigen { template + typename _Traits=DEFAULT_FFT_IMPL<_Scalar> > class FFT { @@ -90,6 +90,6 @@ class FFT private: traits_type m_traits; }; -#undef DEFAULT_FFT_TRAITS +#undef DEFAULT_FFT_IMPL } #endif diff --git a/unsupported/Eigen/src/FFT/simple_fft_traits.h b/unsupported/Eigen/src/FFT/ei_kissfft_impl.h similarity index 95% rename from unsupported/Eigen/src/FFT/simple_fft_traits.h rename to unsupported/Eigen/src/FFT/ei_kissfft_impl.h index 1e2be8f79..ce2c9f16e 100644 --- a/unsupported/Eigen/src/FFT/simple_fft_traits.h +++ b/unsupported/Eigen/src/FFT/ei_kissfft_impl.h @@ -24,16 +24,15 @@ #include #include -#include namespace Eigen { template - struct simple_fft_traits + struct ei_kissfft_impl { typedef _Scalar Scalar; typedef std::complex Complex; - simple_fft_traits() : m_nfft(0) {} + ei_kissfft_impl() : m_nfft(0) {} template void fwd( Complex * dst,const _Src *src,int nfft) @@ -370,5 +369,29 @@ namespace Eigen { std::vector m_realTwiddles; std::vector m_stageRadix; std::vector m_stageRemainder; +/* + enum {FORWARD,INVERSE,REAL,COMPLEX}; + + struct PlanKey + { + PlanKey(int nfft,bool isinverse,bool iscomplex) + { + _key = (nfft<<2) | (isinverse<<1) | iscomplex; + } + + bool operator<(const PlanKey & other) const + { + return this->_key < other._key; + } + int _key; + }; + + struct PlanData + { + std::vector m_twiddles; + }; + + std::map. #include "main.h" -#include - +#include using namespace std;