86 if (inPlace)
fOut =
nullptr;
109 for (
Int_t i=0; i<ndim; i++){
125 fftw_destroy_plan((fftw_plan)
fPlan);
137 fftw_free((fftw_r2r_kind*)
fKind);
178 fftw_destroy_plan((fftw_plan)
fPlan);
182 fKind = (fftw_r2r_kind*)fftw_malloc(
sizeof(fftw_r2r_kind)*
fNdim);
199 fftw_execute((fftw_plan)
fPlan);
201 Error(
"Transform",
"transform hasn't been initialised");
212 Error(
"GetType",
"Type not defined yet (kind not set)");
215 if (((fftw_r2r_kind*)
fKind)[0]==FFTW_R2HC)
return "R2HC";
216 if (((fftw_r2r_kind*)
fKind)[0]==FFTW_HC2R)
return "HC2R";
217 if (((fftw_r2r_kind*)
fKind)[0]==FFTW_DHT)
return "DHT";
238 Error(
"GetPointReal",
"No such point");
242 return ( array ) ? array[ipoint] : 0;
250 Int_t ireal = ipoint[0];
252 ireal=
fN[i+1]*ireal + ipoint[i+1];
255 return ( array ) ? array[ireal] : 0;
265 if ( ( ((fftw_r2r_kind*)
fKind)[0]==FFTW_R2HC && !fromInput ) ||
266 ( ((fftw_r2r_kind*)
fKind)[0]==FFTW_HC2R && fromInput ) )
268 if (ipoint<
fN[0]/2+1){
270 im = array[
fN[0]-ipoint];
272 re = array[
fN[0]-ipoint];
275 if ((
fN[0]%2)==0 && ipoint==
fN[0]/2) im = 0;
298 if (!fromInput &&
fOut)
300 else if (fromInput && !
fOut) {
301 Error(
"GetPointsReal",
"Input array was destroyed");
313 Error(
"SetPoint",
"illegal point index");
316 if (((fftw_r2r_kind*)
fKind)[0]==FFTW_HC2R){
317 if ((
fN[0]%2)==0 && ipoint==
fN[0]/2)
334 Int_t ireal = ipoint[0];
336 ireal=
fN[i+1]*ireal + ipoint[i+1];
338 Error(
"SetPoint",
"illegal point index");
360 Error(
"Init",
"Multidimensional R2HC transforms are not supported, use R2C interface instead");
363 ((fftw_r2r_kind*)
fKind)[0] = FFTW_R2HC;
365 else if (kind[0] == 11) {
367 Error(
"Init",
"Multidimensional HC2R transforms are not supported, use C2R interface instead");
370 ((fftw_r2r_kind*)
fKind)[0] = FFTW_HC2R;
372 else if (kind[0] == 12) {
374 ((fftw_r2r_kind*)
fKind)[i] = FFTW_DHT;
379 case 0: ((fftw_r2r_kind*)
fKind)[i] = FFTW_REDFT00;
break;
380 case 1: ((fftw_r2r_kind*)
fKind)[i] = FFTW_REDFT01;
break;
381 case 2: ((fftw_r2r_kind*)
fKind)[i] = FFTW_REDFT10;
break;
382 case 3: ((fftw_r2r_kind*)
fKind)[i] = FFTW_REDFT11;
break;
383 case 4: ((fftw_r2r_kind*)
fKind)[i] = FFTW_RODFT00;
break;
384 case 5: ((fftw_r2r_kind*)
fKind)[i] = FFTW_RODFT01;
break;
385 case 6: ((fftw_r2r_kind*)
fKind)[i] = FFTW_RODFT10;
break;
386 case 7: ((fftw_r2r_kind*)
fKind)[i] = FFTW_RODFT11;
break;
388 ((fftw_r2r_kind*)
fKind)[i] = FFTW_R2HC;
break;
407 return FFTW_ESTIMATE;
413 return FFTW_EXHAUSTIVE;
414 return FFTW_ESTIMATE;
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char).
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