changed name from simple_fft_traits to ei_kissfft_impl

This commit is contained in:
Mark Borgerding 2009-05-25 20:35:24 -04:00
parent 326ea77390
commit 210092d16c
4 changed files with 37 additions and 15 deletions

View File

@ -26,7 +26,7 @@
#include <vector> #include <vector>
#include <Eigen/Core> #include <Eigen/Core>
#include <bench/BenchTimer.h> #include <bench/BenchTimer.h>
#include <unsupported/Eigen/FFT.h> #include <unsupported/Eigen/FFT>
using namespace Eigen; using namespace Eigen;
using namespace std; using namespace std;

View File

@ -25,28 +25,28 @@
#ifndef EIGEN_FFT_H #ifndef EIGEN_FFT_H
#define EIGEN_FFT_H #define EIGEN_FFT_H
// simple_fft_traits: small, free, reasonably efficient default, derived from kissfft // ei_kissfft_impl: small, free, reasonably efficient default, derived from kissfft
#include "src/FFT/simple_fft_traits.h" #include "src/FFT/ei_kissfft_impl.h"
#define DEFAULT_FFT_TRAITS simple_fft_traits #define DEFAULT_FFT_IMPL ei_kissfft_impl
// FFTW: faster, GPL-not LGPL, bigger code size // 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 #ifdef FFTW_PATIENT // definition of FFTW_PATIENT indicates the caller has included fftw3.h, we can use FFTW routines
// TODO // TODO
// #include "src/FFT/fftw_traits.h" // #include "src/FFT/ei_fftw_impl.h"
// #define DEFAULT_FFT_TRAITS fftw_traits // #define DEFAULT_FFT_IMPL ei_fftw_impl
#endif #endif
// intel Math Kernel Library: fastest, commerical // intel Math Kernel Library: fastest, commerical
#ifdef _MKL_DFTI_H_ // mkl_dfti.h has been included, we can use MKL FFT routines #ifdef _MKL_DFTI_H_ // mkl_dfti.h has been included, we can use MKL FFT routines
// TODO // TODO
// #include "src/FFT/imkl_traits.h" // #include "src/FFT/ei_imkl_impl.h"
// #define DEFAULT_FFT_TRAITS imkl_traits // #define DEFAULT_FFT_IMPL ei_imkl_impl
#endif #endif
namespace Eigen { namespace Eigen {
template <typename _Scalar, template <typename _Scalar,
typename _Traits=DEFAULT_FFT_TRAITS<_Scalar> typename _Traits=DEFAULT_FFT_IMPL<_Scalar>
> >
class FFT class FFT
{ {
@ -90,6 +90,6 @@ class FFT
private: private:
traits_type m_traits; traits_type m_traits;
}; };
#undef DEFAULT_FFT_TRAITS #undef DEFAULT_FFT_IMPL
} }
#endif #endif

View File

@ -24,16 +24,15 @@
#include <complex> #include <complex>
#include <vector> #include <vector>
#include <iostream>
namespace Eigen { namespace Eigen {
template <typename _Scalar> template <typename _Scalar>
struct simple_fft_traits struct ei_kissfft_impl
{ {
typedef _Scalar Scalar; typedef _Scalar Scalar;
typedef std::complex<Scalar> Complex; typedef std::complex<Scalar> Complex;
simple_fft_traits() : m_nfft(0) {} ei_kissfft_impl() : m_nfft(0) {}
template <typename _Src> template <typename _Src>
void fwd( Complex * dst,const _Src *src,int nfft) void fwd( Complex * dst,const _Src *src,int nfft)
@ -370,5 +369,29 @@ namespace Eigen {
std::vector<Complex> m_realTwiddles; std::vector<Complex> m_realTwiddles;
std::vector<int> m_stageRadix; std::vector<int> m_stageRadix;
std::vector<int> m_stageRemainder; std::vector<int> 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<Complex> m_twiddles;
};
std::map<PlanKey,
*/
}; };
} }

View File

@ -23,8 +23,7 @@
// Eigen. If not, see <http://www.gnu.org/licenses/>. // Eigen. If not, see <http://www.gnu.org/licenses/>.
#include "main.h" #include "main.h"
#include <unsupported/Eigen/FFT.h> #include <unsupported/Eigen/FFT>
using namespace std; using namespace std;