66 fIn = fftw_malloc(
sizeof(fftw_complex) *n);
68 fOut = fftw_malloc(
sizeof(fftw_complex) * n);
88 for (Int_t i=0; i<
fNdim; i++){
94 fOut = fftw_malloc(
sizeof(fftw_complex) * fTotalSize);
108 fftw_destroy_plan((fftw_plan)
fPlan);
110 fftw_free((fftw_complex*)
fIn);
112 fftw_free((fftw_complex*)
fOut);
141 fftw_destroy_plan((fftw_plan)
fPlan);
145 fPlan = (
void*)fftw_plan_dft(
fNdim,
fN, (fftw_complex*)
fIn, (fftw_complex*)
fOut, sign,
MapFlag(flags));
147 fPlan = (
void*)fftw_plan_dft(
fNdim,
fN, (fftw_complex*)
fIn, (fftw_complex*)
fIn, sign,
MapFlag(flags));
156 fftw_execute((fftw_plan)
fPlan);
158 Error(
"Transform",
"transform not initialised");
170 data[i] = ((fftw_complex*)
fOut)[i/2][0];
171 data[i+1] = ((fftw_complex*)
fOut)[i/2][1];
175 data[i] = ((fftw_complex*)
fIn)[i/2][0];
176 data[i+1] = ((fftw_complex*)
fIn)[i/2][1];
186 if (
fOut && !fromInput){
187 re = ((fftw_complex*)
fOut)[ipoint][0];
188 im = ((fftw_complex*)
fOut)[ipoint][1];
190 re = ((fftw_complex*)
fIn)[ipoint][0];
191 im = ((fftw_complex*)
fIn)[ipoint][1];
200 Int_t ireal = ipoint[0];
201 for (Int_t i=0; i<
fNdim-1; i++)
202 ireal=
fN[i+1]*ireal + ipoint[i+1];
204 if (
fOut && !fromInput){
205 re = ((fftw_complex*)
fOut)[ireal][0];
206 im = ((fftw_complex*)
fOut)[ireal][1];
208 re = ((fftw_complex*)
fIn)[ireal][0];
209 im = ((fftw_complex*)
fIn)[ireal][1];
218 if (
fOut && !fromInput){
220 re[i] = ((fftw_complex*)
fOut)[i][0];
221 im[i] = ((fftw_complex*)
fOut)[i][1];
225 re[i] = ((fftw_complex*)
fIn)[i][0];
226 im[i] = ((fftw_complex*)
fIn)[i][1];
236 if (
fOut && !fromInput){
238 data[i] = ((fftw_complex*)
fOut)[i/2][0];
239 data[i+1] = ((fftw_complex*)
fOut)[i/2][1];
243 data[i] = ((fftw_complex*)
fIn)[i/2][0];
244 data[i+1] = ((fftw_complex*)
fIn)[i/2][1];
254 ((fftw_complex*)
fIn)[ipoint][0]=re;
255 ((fftw_complex*)
fIn)[ipoint][1]=im;
263 Int_t ireal = ipoint[0];
264 for (Int_t i=0; i<
fNdim-1; i++)
265 ireal=
fN[i+1]*ireal + ipoint[i+1];
267 ((fftw_complex*)
fIn)[ireal][0]=re;
268 ((fftw_complex*)
fIn)[ireal][1]=im;
275 ((fftw_complex*)
fIn)[ipoint][0] = c.
Re();
276 ((fftw_complex*)
fIn)[ipoint][1] = c.
Im();
286 ((fftw_complex*)
fIn)[i/2][0]=data[i];
287 ((fftw_complex*)
fIn)[i/2][1]=data[i+1];
297 Error(
"SetPointsComplex",
"Size is not set yet");
301 ((fftw_complex*)
fIn)[i][0]=re_data[i];
302 ((fftw_complex*)
fIn)[i][1]=im_data[i];
317 if (opt.Contains(
"ES"))
318 return FFTW_ESTIMATE;
319 if (opt.Contains(
"M"))
321 if (opt.Contains(
"P"))
323 if (opt.Contains(
"EX"))
324 return FFTW_EXHAUSTIVE;
325 return FFTW_ESTIMATE;
virtual void GetPointsComplex(Double_t *re, Double_t *im, Bool_t fromInput=kFALSE) const
Copies real and imaginary parts of the output (input) into the argument arrays.
virtual void SetPoint(Int_t ipoint, Double_t re, Double_t im=0)
sets real and imaginary parts of point # ipoint
virtual void Init(Option_t *flags, Int_t sign, const Int_t *)
Creates the fftw-plan.
virtual void GetPointComplex(Int_t ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const
returns real and imaginary parts of the point #ipoint
virtual void SetPointComplex(Int_t ipoint, TComplex &c)
virtual void Transform()
Computes the transform, specified in Init() function.
UInt_t MapFlag(Option_t *flag)
allowed options: "ES" - FFTW_ESTIMATE "M" - FFTW_MEASURE "P" - FFTW_PATIENT "EX" - FFTW_EXHAUSTIVE ...
virtual void GetPoints(Double_t *data, Bool_t fromInput=kFALSE) const
Copies the output(or input) into the argument array.
virtual ~TFFTComplex()
Destroys the data arrays and the plan.
virtual void SetPoints(const Double_t *data)
set all points.
virtual void SetPointsComplex(const Double_t *re, const Double_t *im)
set all points. the values are copied