87 if (inPlace)
fOut =
nullptr;
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;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
One of the interface classes to the FFTW package, can be used directly or via the TVirtualFFT class.
void Transform() override
Computes the transform, specified in Init() function.
void SetPoint(Int_t ipoint, Double_t re, Double_t im=0) override
UInt_t MapFlag(Option_t *flag)
allowed options:
Double_t * GetPointsReal(Bool_t fromInput=kFALSE) const override
Returns the output (or input) array we have 4 different cases:
void SetPoints(const Double_t *data) override
Sets all points.
void GetPoints(Double_t *data, Bool_t fromInput=kFALSE) const override
Copies the output (or input) points into the provided array, that should be big enough.
Double_t GetPointReal(Int_t ipoint, Bool_t fromInput=kFALSE) const override
For 1d transformations. Returns point #ipoint
Option_t * GetType() const override
Returns the type of the transform.
Int_t MapOptions(const Int_t *kind)
transfers the r2r_kind parameters to fftw type
void Init(Option_t *flags, Int_t sign, const Int_t *kind) override
Creates the fftw-plan.
void GetPointComplex(const Int_t *ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const override
Only for input of HC2R and output of R2HC and for 1d.
~TFFTReal() override
clean-up
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