73 fOut = fftw_malloc(
sizeof(fftw_complex)*(
n/2+1));
91 if (ndim>1 && inPlace==
kTRUE){
92 Error(
"TFFTRealComplex",
"multidimensional in-place r2c transforms are not implemented yet");
105 fOut = fftw_malloc(
sizeof(fftw_complex)*sizeout);
120 fftw_destroy_plan((fftw_plan)
fPlan);
125 fftw_free((fftw_complex*)
fOut);
156 fftw_destroy_plan((fftw_plan)
fPlan);
172 fftw_execute((fftw_plan)
fPlan);
175 Error(
"Transform",
"transform hasn't been initialised");
193 for (
Int_t i=0; i<realN; i+=2){
194 data[i] = ((fftw_complex*)
fOut)[i/2][0];
195 data[i+1] = ((fftw_complex*)
fOut)[i/2][1];
199 for (
Int_t i=0; i<realN; i++)
211 if (
fOut && !fromInput){
212 Warning(
"GetPointReal",
"Output is complex. Only real part returned");
213 return ((fftw_complex*)
fOut)[ipoint][0];
225 Int_t ireal = ipoint[0];
227 ireal=
fN[i+1]*ireal + ipoint[i+1];
229 if (
fOut && !fromInput){
230 Warning(
"GetPointReal",
"Output is complex. Only real part returned");
231 return ((fftw_complex*)
fOut)[ireal][0];
251 if (ipoint<
fN[0]/2+1){
252 re = ((fftw_complex*)
fOut)[ipoint][0];
253 im = ((fftw_complex*)
fOut)[ipoint][1];
255 re = ((fftw_complex*)
fOut)[
fN[0]-ipoint][0];
256 im = -((fftw_complex*)
fOut)[
fN[0]-ipoint][1];
259 if (ipoint<
fN[0]/2+1){
271 Error(
"GetPointComplex",
"Illegal index value");
275 re = ((fftw_complex*)
fOut)[ipoint][0];
276 im = ((fftw_complex*)
fOut)[ipoint][1];
292 Int_t ireal = ipoint[0];
294 ireal=
fN[i+1]*ireal + ipoint[i+1];
304 if (ipoint[0] <
fN[0]/2+1){
305 re = ((fftw_complex*)
fOut)[ipoint[0]][0];
306 im = ((fftw_complex*)
fOut)[ipoint[0]][1];
308 re = ((fftw_complex*)
fOut)[
fN[0]-ipoint[0]][0];
309 im = -((fftw_complex*)
fOut)[
fN[0]-ipoint[0]][1];
312 if (ireal <
fN[0]/2+1){
323 if (ipoint[1]<
fN[1]/2+1){
324 re = ((fftw_complex*)
fOut)[ipoint[1]+(
fN[1]/2+1)*ipoint[0]][0];
325 im = ((fftw_complex*)
fOut)[ipoint[1]+(
fN[1]/2+1)*ipoint[0]][1];
328 re = ((fftw_complex*)
fOut)[
fN[1]-ipoint[1]][0];
329 im = -((fftw_complex*)
fOut)[
fN[1]-ipoint[1]][1];
331 re = ((fftw_complex*)
fOut)[(
fN[1]-ipoint[1])+(
fN[1]/2+1)*(
fN[0]-ipoint[0])][0];
332 im = -((fftw_complex*)
fOut)[(
fN[1]-ipoint[1])+(
fN[1]/2+1)*(
fN[0]-ipoint[0])][1];
336 if (ipoint[1]<
fN[1]/2+1){
338 im = ((
Double_t*)
fIn)[2*(ipoint[1]+(
fN[1]/2+1)*ipoint[0])+1];
353 re = ((fftw_complex*)
fOut)[ireal][0];
354 im = ((fftw_complex*)
fOut)[ireal][1];
370 Error(
"GetPointsReal",
"Output array is complex");
384 if (
fOut && !fromInput){
386 for (
Int_t i=0; i<nreal; i++){
387 re[i] = ((fftw_complex*)
fOut)[i][0];
388 im[i] = ((fftw_complex*)
fOut)[i][1];
390 }
else if (fromInput) {
398 for (
Int_t i=0; i<nreal; i+=2){
414 if (
fOut && !fromInput){
417 for (
Int_t i=0; i<nreal; i+=2){
418 data[i] = ((fftw_complex*)
fOut)[i/2][0];
419 data[i+1] = ((fftw_complex*)
fOut)[i/2][1];
421 }
else if (fromInput){
430 for (
Int_t i=0; i<nreal; i++)
448 Int_t ireal = ipoint[0];
450 ireal=
fN[i+1]*ireal + ipoint[i+1];
494 return FFTW_ESTIMATE;
500 return FFTW_EXHAUSTIVE;
501 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).
UInt_t MapFlag(Option_t *flag)
allowed options: "ES" "M" "P" "EX"
void Init(Option_t *flags, Int_t, const Int_t *) override
Creates the fftw-plan.
void GetPointComplex(Int_t ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const override
Returns the point #ipoint.
void SetPoints(const Double_t *data) override
Set all input points.
Double_t * GetPointsReal(Bool_t fromInput=kFALSE) const override
Returns the input array// One of the interface classes to the FFTW package, can be used directly or v...
Double_t GetPointReal(Int_t ipoint, Bool_t fromInput=kFALSE) const override
Returns the real part of the point #ipoint from the output or the point #ipoint from the input.
void SetPointComplex(Int_t ipoint, TComplex &c) override
Sets the point #ipoint (only the real part of the argument is taken).
void GetPointsComplex(Double_t *re, Double_t *im, Bool_t fromInput=kFALSE) const override
Fills the argument arrays with the real and imaginary parts of the computed transform.
void SetPointsComplex(const Double_t *re, const Double_t *im) override
Set all points. Only the real array is used.
void SetPoint(Int_t ipoint, Double_t re, Double_t im=0) override
Set the point #ipoint.
void GetPoints(Double_t *data, Bool_t fromInput=kFALSE) const override
Fills the array data with the computed transform.
void Transform() override
Computes the transform, specified in Init() function.
~TFFTRealComplex() override
Destroys the data arrays and the plan.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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