23 #ifndef COM_DAFER45_TBTK_FOURIER_TRANSFORM
24 #define COM_DAFER45_TBTK_FOURIER_TRANSFORM
48 template<
typename DataType>
55 const std::vector<unsigned int> &ranges,
84 double normalizationFactor;
96 fftw_plan& getFFTWPlan();
99 unsigned int getSize()
const;
112 template<
typename DataType>
119 const std::vector<unsigned int> &ranges
120 ) :
Plan<DataType>(in, out, ranges, -1){}
124 template<
typename DataType>
131 const std::vector<unsigned int> &ranges
132 ) :
Plan<DataType>(in, out, ranges, 1
144 const CArray<std::complex<double>> &in,
145 CArray<std::complex<double>> &out,
146 const std::vector<unsigned int> &ranges,
153 template<
typename DataType>
154 static void transform(Plan<DataType> &plan);
162 const CArray<std::complex<double>> &in,
163 CArray<std::complex<double>> &out,
164 const std::vector<unsigned int> &ranges
173 const CArray<std::complex<double>> &in,
174 CArray<std::complex<double>> &out,
175 const std::vector<unsigned int> &ranges
181 template<
typename DataType>
183 fftw_execute(plan.getFFTWPlan());
186 if(normalizationFactor != 1.){
188 for(
unsigned int n = 0; n < plan.getSize(); n++)
189 output[n] /= normalizationFactor;
194 const CArray<std::complex<double>> &in,
195 CArray<std::complex<double>> &out,
196 const std::vector<unsigned int> &ranges
202 const CArray<std::complex<double>> &in,
203 CArray<std::complex<double>> &out,
204 const std::vector<unsigned int> &ranges
209 template<
typename DataType>
211 this->plan = plan.plan;
214 normalizationFactor = plan.normalizationFactor;
217 output = plan.output;
220 template<
typename DataType>
223 #pragma omp critical (TBTK_FOURIER_TRANSFORM)
224 fftw_destroy_plan(*plan);
231 template<
typename DataType>
236 if(this->plan !=
nullptr){
237 #pragma omp critical (TBTK_FOURIER_TRANSFORM)
238 fftw_destroy_plan(*this->plan);
242 this->plan = rhs.plan;
244 normalizationFactor = rhs.normalizationFactor;
254 template<
typename DataType>
256 double normalizationFactor
258 this->normalizationFactor = normalizationFactor;
261 template<
typename DataType>
263 return normalizationFactor;
266 template<
typename DataType>
271 template<
typename DataType>
276 template<
typename DataType>
277 inline CArray<DataType>& FourierTransform::Plan<DataType>::getInput(){
281 template<
typename DataType>
282 inline CArray<DataType>& FourierTransform::Plan<DataType>::getOutput(){