26 return const_cast<T*
>( p);
30 fftw_complex *
fftw_cast(
const std::complex<double> * p)
32 return const_cast<fftw_complex*
>(
reinterpret_cast<const fftw_complex*
>(p) );
36 fftwf_complex *
fftw_cast(
const std::complex<float> * p)
38 return const_cast<fftwf_complex*
>(
reinterpret_cast<const fftwf_complex*
>(p) );
42 fftwl_complex *
fftw_cast(
const std::complex<long double> * p)
44 return const_cast<fftwl_complex*
>(
reinterpret_cast<const fftwl_complex*
>(p) );
60 void fwd(complex_type * dst,complex_type * src,
int nfft) {
61 if (m_plan==NULL) m_plan = fftwf_plan_dft_1d(nfft,src,dst, FFTW_FORWARD, FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
62 fftwf_execute_dft( m_plan, src,dst);
65 void inv(complex_type * dst,complex_type * src,
int nfft) {
66 if (m_plan==NULL) m_plan = fftwf_plan_dft_1d(nfft,src,dst, FFTW_BACKWARD , FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
67 fftwf_execute_dft( m_plan, src,dst);
70 void fwd(complex_type * dst,scalar_type * src,
int nfft) {
71 if (m_plan==NULL) m_plan = fftwf_plan_dft_r2c_1d(nfft,src,dst,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
72 fftwf_execute_dft_r2c( m_plan,src,dst);
75 void inv(scalar_type * dst,complex_type * src,
int nfft) {
77 m_plan = fftwf_plan_dft_c2r_1d(nfft,src,dst,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
78 fftwf_execute_dft_c2r( m_plan, src,dst);
82 void fwd2( complex_type * dst,complex_type * src,
int n0,
int n1) {
83 if (m_plan==NULL) m_plan = fftwf_plan_dft_2d(n0,n1,src,dst,FFTW_FORWARD,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
84 fftwf_execute_dft( m_plan, src,dst);
87 void inv2( complex_type * dst,complex_type * src,
int n0,
int n1) {
88 if (m_plan==NULL) m_plan = fftwf_plan_dft_2d(n0,n1,src,dst,FFTW_BACKWARD,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
89 fftwf_execute_dft( m_plan, src,dst);
103 void fwd(complex_type * dst,complex_type * src,
int nfft) {
104 if (m_plan==NULL) m_plan = fftw_plan_dft_1d(nfft,src,dst, FFTW_FORWARD, FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
105 fftw_execute_dft( m_plan, src,dst);
108 void inv(complex_type * dst,complex_type * src,
int nfft) {
109 if (m_plan==NULL) m_plan = fftw_plan_dft_1d(nfft,src,dst, FFTW_BACKWARD , FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
110 fftw_execute_dft( m_plan, src,dst);
113 void fwd(complex_type * dst,scalar_type * src,
int nfft) {
114 if (m_plan==NULL) m_plan = fftw_plan_dft_r2c_1d(nfft,src,dst,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
115 fftw_execute_dft_r2c( m_plan,src,dst);
118 void inv(scalar_type * dst,complex_type * src,
int nfft) {
120 m_plan = fftw_plan_dft_c2r_1d(nfft,src,dst,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
121 fftw_execute_dft_c2r( m_plan, src,dst);
124 void fwd2( complex_type * dst,complex_type * src,
int n0,
int n1) {
125 if (m_plan==NULL) m_plan = fftw_plan_dft_2d(n0,n1,src,dst,FFTW_FORWARD,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
126 fftw_execute_dft( m_plan, src,dst);
129 void inv2( complex_type * dst,complex_type * src,
int n0,
int n1) {
130 if (m_plan==NULL) m_plan = fftw_plan_dft_2d(n0,n1,src,dst,FFTW_BACKWARD,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
131 fftw_execute_dft( m_plan, src,dst);
144 void fwd(complex_type * dst,complex_type * src,
int nfft) {
145 if (m_plan==NULL) m_plan = fftwl_plan_dft_1d(nfft,src,dst, FFTW_FORWARD, FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
146 fftwl_execute_dft( m_plan, src,dst);
149 void inv(complex_type * dst,complex_type * src,
int nfft) {
150 if (m_plan==NULL) m_plan = fftwl_plan_dft_1d(nfft,src,dst, FFTW_BACKWARD , FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
151 fftwl_execute_dft( m_plan, src,dst);
154 void fwd(complex_type * dst,scalar_type * src,
int nfft) {
155 if (m_plan==NULL) m_plan = fftwl_plan_dft_r2c_1d(nfft,src,dst,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
156 fftwl_execute_dft_r2c( m_plan,src,dst);
159 void inv(scalar_type * dst,complex_type * src,
int nfft) {
161 m_plan = fftwl_plan_dft_c2r_1d(nfft,src,dst,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
162 fftwl_execute_dft_c2r( m_plan, src,dst);
165 void fwd2( complex_type * dst,complex_type * src,
int n0,
int n1) {
166 if (m_plan==NULL) m_plan = fftwl_plan_dft_2d(n0,n1,src,dst,FFTW_FORWARD,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
167 fftwl_execute_dft( m_plan, src,dst);
170 void inv2( complex_type * dst,complex_type * src,
int n0,
int n1) {
171 if (m_plan==NULL) m_plan = fftwl_plan_dft_2d(n0,n1,src,dst,FFTW_BACKWARD,FFTW_ESTIMATE|FFTW_PRESERVE_INPUT);
172 fftwl_execute_dft( m_plan, src,dst);
176 template <
typename _Scalar>
190 void fwd( Complex * dst,
const Complex *src,
int nfft)
197 void fwd( Complex * dst,
const Scalar * src,
int nfft)
204 void fwd2(Complex * dst,
const Complex * src,
int n0,
int n1)
211 void inv(Complex * dst,
const Complex *src,
int nfft)
218 void inv( Scalar * dst,
const Complex * src,
int nfft)
225 void inv2(Complex * dst,
const Complex * src,
int n0,
int n1)
241 bool inplace = (dst==src);
242 bool aligned = ( (
reinterpret_cast<size_t>(src)&15) | (
reinterpret_cast<size_t>(dst)&15) ) == 0;
243 int64_t key = ( (nfft<<3 ) | (inverse<<2) | (inplace<<1) | aligned ) << 1;
250 bool inplace = (dst==src);
251 bool aligned = ( (
reinterpret_cast<size_t>(src)&15) | (
reinterpret_cast<size_t>(dst)&15) ) == 0;
252 int64_t key = ( ( (((int64_t)n0) << 30)|(n1<<3 ) | (inverse<<2) | (inplace<<1) | aligned ) << 1 ) + 1;
void inv(complex_type *dst, complex_type *src, int nfft)
void inv(scalar_type *dst, complex_type *src, int nfft)
void inv(scalar_type *dst, complex_type *src, int nfft)
void fwd(Complex *dst, const Complex *src, int nfft)
fftwl_complex complex_type
void fwd2(complex_type *dst, complex_type *src, int n0, int n1)
void inv2(complex_type *dst, complex_type *src, int n0, int n1)
void inv(Complex *dst, const Complex *src, int nfft)
fftw_plan< Scalar > PlanData
void fwd(Complex *dst, const Scalar *src, int nfft)
void inv2(complex_type *dst, complex_type *src, int n0, int n1)
void fwd(complex_type *dst, scalar_type *src, int nfft)
fftw_complex complex_type
std::complex< Scalar > Complex
void inv(scalar_type *dst, complex_type *src, int nfft)
void inv(Scalar *dst, const Complex *src, int nfft)
void inv(complex_type *dst, complex_type *src, int nfft)
void inv2(Complex *dst, const Complex *src, int n0, int n1)
void fwd2(complex_type *dst, complex_type *src, int n0, int n1)
void fwd(complex_type *dst, complex_type *src, int nfft)
void fwd2(Complex *dst, const Complex *src, int n0, int n1)
void inv2(complex_type *dst, complex_type *src, int n0, int n1)
void fwd(complex_type *dst, scalar_type *src, int nfft)
std::map< int64_t, PlanData > PlanMap
PlanData & get_plan(int n0, int n1, bool inverse, void *dst, const void *src)
fftwf_complex complex_type
void fwd2(complex_type *dst, complex_type *src, int n0, int n1)
T * fftw_cast(const T *p)
void fwd(complex_type *dst, complex_type *src, int nfft)
void inv(complex_type *dst, complex_type *src, int nfft)
EIGEN_DEVICE_FUNC const InverseReturnType inverse() const
void fwd(complex_type *dst, scalar_type *src, int nfft)
PlanData & get_plan(int nfft, bool inverse, void *dst, const void *src)
void fwd(complex_type *dst, complex_type *src, int nfft)