87 if (inPlace)
fOut = 0;
110 for (
Int_t i=0; i<ndim; i++){
126 fftw_destroy_plan((fftw_plan)
fPlan);
138 fftw_free((fftw_r2r_kind*)
fKind);
179 fftw_destroy_plan((fftw_plan)
fPlan);
183 fKind = (fftw_r2r_kind*)fftw_malloc(
sizeof(fftw_r2r_kind)*
fNdim);
200 fftw_execute((fftw_plan)
fPlan);
202 Error(
"Transform",
"transform hasn't been initialised");
213 Error(
"GetType",
"Type not defined yet (kind not set)");
216 if (((fftw_r2r_kind*)
fKind)[0]==FFTW_R2HC)
return "R2HC";
217 if (((fftw_r2r_kind*)
fKind)[0]==FFTW_HC2R)
return "HC2R";
218 if (((fftw_r2r_kind*)
fKind)[0]==FFTW_DHT)
return "DHT";
239 Error(
"GetPointReal",
"No such point");
243 return ( array ) ? array[ipoint] : 0;
251 Int_t ireal = ipoint[0];
253 ireal=
fN[i+1]*ireal + ipoint[i+1];
256 return ( array ) ? array[ireal] : 0;
266 if ( ( ((fftw_r2r_kind*)
fKind)[0]==FFTW_R2HC && !fromInput ) ||
267 ( ((fftw_r2r_kind*)
fKind)[0]==FFTW_HC2R && fromInput ) )
269 if (ipoint<
fN[0]/2+1){
271 im = array[
fN[0]-ipoint];
273 re = array[
fN[0]-ipoint];
276 if ((
fN[0]%2)==0 && ipoint==
fN[0]/2) im = 0;
299 if (!fromInput &&
fOut)
301 else if (fromInput && !
fOut) {
302 Error(
"GetPointsReal",
"Input array was destroyed");
314 Error(
"SetPoint",
"illegal point index");
317 if (((fftw_r2r_kind*)
fKind)[0]==FFTW_HC2R){
318 if ((
fN[0]%2)==0 && ipoint==
fN[0]/2)
335 Int_t ireal = ipoint[0];
337 ireal=
fN[i+1]*ireal + ipoint[i+1];
339 Error(
"SetPoint",
"illegal point index");
361 Error(
"Init",
"Multidimensional R2HC transforms are not supported, use R2C interface instead");
364 ((fftw_r2r_kind*)
fKind)[0] = FFTW_R2HC;
366 else if (kind[0] == 11) {
368 Error(
"Init",
"Multidimensional HC2R transforms are not supported, use C2R interface instead");
371 ((fftw_r2r_kind*)
fKind)[0] = FFTW_HC2R;
373 else if (kind[0] == 12) {
375 ((fftw_r2r_kind*)
fKind)[i] = FFTW_DHT;
380 case 0: ((fftw_r2r_kind*)
fKind)[i] = FFTW_REDFT00;
break;
381 case 1: ((fftw_r2r_kind*)
fKind)[i] = FFTW_REDFT01;
break;
382 case 2: ((fftw_r2r_kind*)
fKind)[i] = FFTW_REDFT10;
break;
383 case 3: ((fftw_r2r_kind*)
fKind)[i] = FFTW_REDFT11;
break;
384 case 4: ((fftw_r2r_kind*)
fKind)[i] = FFTW_RODFT00;
break;
385 case 5: ((fftw_r2r_kind*)
fKind)[i] = FFTW_RODFT01;
break;
386 case 6: ((fftw_r2r_kind*)
fKind)[i] = FFTW_RODFT10;
break;
387 case 7: ((fftw_r2r_kind*)
fKind)[i] = FFTW_RODFT11;
break;
389 ((fftw_r2r_kind*)
fKind)[i] = FFTW_R2HC;
break;
408 return FFTW_ESTIMATE;
414 return FFTW_EXHAUSTIVE;
415 return FFTW_ESTIMATE;
One of the interface classes to the FFTW package, can be used directly or via the TVirtualFFT class.
virtual void Transform()
Computes the transform, specified in Init() function.
virtual void Init(Option_t *flags, Int_t sign, const Int_t *kind)
Creates the fftw-plan.
virtual Option_t * GetType() const
Returns the type of the transform.
virtual void GetPoints(Double_t *data, Bool_t fromInput=kFALSE) const
Copies the output (or input) points into the provided array, that should be big enough.
UInt_t MapFlag(Option_t *flag)
allowed options:
virtual Double_t * GetPointsReal(Bool_t fromInput=kFALSE) const
Returns the output (or input) array we have 4 different cases:
virtual void GetPointComplex(const Int_t *ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const
Only for input of HC2R and output of R2HC and for 1d.
virtual void SetPoints(const Double_t *data)
Sets all points.
virtual ~TFFTReal()
clean-up
Int_t MapOptions(const Int_t *kind)
transfers the r2r_kind parameters to fftw type
virtual Double_t GetPointReal(Int_t ipoint, Bool_t fromInput=kFALSE) const
For 1d tranforms. Returns point #ipoint.
virtual void SetPoint(Int_t ipoint, Double_t re, Double_t im=0)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void ToUpper()
Change string to upper case.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const