74 fOut = fftw_malloc(
sizeof(fftw_complex)*(n/2+1));
93 if (ndim>1 && inPlace==
kTRUE){
94 Error(
"TFFTRealComplex",
"multidimensional in-place r2c transforms are not implemented yet");
107 fOut = fftw_malloc(
sizeof(fftw_complex)*sizeout);
123 fftw_destroy_plan((fftw_plan)
fPlan);
128 fftw_free((fftw_complex*)
fOut);
157 fftw_destroy_plan((fftw_plan)
fPlan);
173 fftw_execute((fftw_plan)
fPlan);
176 Error(
"Transform",
"transform hasn't been initialised");
194 for (
Int_t i=0; i<realN; i+=2){
195 data[i] = ((fftw_complex*)
fOut)[i/2][0];
196 data[i+1] = ((fftw_complex*)
fOut)[i/2][1];
200 for (
Int_t i=0; i<realN; i++)
212 if (
fOut && !fromInput){
213 Warning(
"GetPointReal",
"Output is complex. Only real part returned");
214 return ((fftw_complex*)
fOut)[ipoint][0];
226 Int_t ireal = ipoint[0];
228 ireal=
fN[i+1]*ireal + ipoint[i+1];
230 if (
fOut && !fromInput){
231 Warning(
"GetPointReal",
"Output is complex. Only real part returned");
232 return ((fftw_complex*)
fOut)[ireal][0];
252 if (ipoint<
fN[0]/2+1){
253 re = ((fftw_complex*)
fOut)[ipoint][0];
254 im = ((fftw_complex*)
fOut)[ipoint][1];
256 re = ((fftw_complex*)
fOut)[
fN[0]-ipoint][0];
257 im = -((fftw_complex*)
fOut)[
fN[0]-ipoint][1];
260 if (ipoint<
fN[0]/2+1){
272 Error(
"GetPointComplex",
"Illegal index value");
276 re = ((fftw_complex*)
fOut)[ipoint][0];
277 im = ((fftw_complex*)
fOut)[ipoint][1];
293 Int_t ireal = ipoint[0];
295 ireal=
fN[i+1]*ireal + ipoint[i+1];
297 ireal = (
fN[fNdim-1]/2+1)*ireal + ipoint[fNdim-1];
305 if (ipoint[0] <
fN[0]/2+1){
306 re = ((fftw_complex*)
fOut)[ipoint[0]][0];
307 im = ((fftw_complex*)
fOut)[ipoint[0]][1];
309 re = ((fftw_complex*)
fOut)[
fN[0]-ipoint[0]][0];
310 im = -((fftw_complex*)
fOut)[
fN[0]-ipoint[0]][1];
313 if (ireal <
fN[0]/2+1){
324 if (ipoint[1]<
fN[1]/2+1){
325 re = ((fftw_complex*)
fOut)[ipoint[1]+(
fN[1]/2+1)*ipoint[0]][0];
326 im = ((fftw_complex*)
fOut)[ipoint[1]+(
fN[1]/2+1)*ipoint[0]][1];
329 re = ((fftw_complex*)
fOut)[
fN[1]-ipoint[1]][0];
330 im = -((fftw_complex*)
fOut)[
fN[1]-ipoint[1]][1];
332 re = ((fftw_complex*)
fOut)[(
fN[1]-ipoint[1])+(
fN[1]/2+1)*(
fN[0]-ipoint[0])][0];
333 im = -((fftw_complex*)
fOut)[(
fN[1]-ipoint[1])+(
fN[1]/2+1)*(
fN[0]-ipoint[0])][1];
337 if (ipoint[1]<
fN[1]/2+1){
339 im = ((
Double_t*)
fIn)[2*(ipoint[1]+(fN[1]/2+1)*ipoint[0])+1];
354 re = ((fftw_complex*)
fOut)[ireal][0];
355 im = ((fftw_complex*)
fOut)[ireal][1];
371 Error(
"GetPointsReal",
"Output array is complex");
385 if (
fOut && !fromInput){
387 for (
Int_t i=0; i<nreal; i++){
388 re[i] = ((fftw_complex*)
fOut)[i][0];
389 im[i] = ((fftw_complex*)
fOut)[i][1];
391 }
else if (fromInput) {
399 for (
Int_t i=0; i<nreal; i+=2){
415 if (
fOut && !fromInput){
418 for (
Int_t i=0; i<nreal; i+=2){
419 data[i] = ((fftw_complex*)
fOut)[i/2][0];
420 data[i+1] = ((fftw_complex*)
fOut)[i/2][1];
422 }
else if (fromInput){
431 for (
Int_t i=0; i<nreal; i++)
449 Int_t ireal = ipoint[0];
451 ireal=
fN[i+1]*ireal + ipoint[i+1];
495 return FFTW_ESTIMATE;
501 return FFTW_EXHAUSTIVE;
502 return FFTW_ESTIMATE;
virtual Double_t GetPointReal(Int_t ipoint, Bool_t fromInput=kFALSE) const
Returns the real part of the point #ipoint from the output or the point #ipoint from the input...
void ToUpper()
Change string to upper case.
virtual ~TFFTRealComplex()
Destroys the data arrays and the plan.
virtual void GetPointsComplex(Double_t *re, Double_t *im, Bool_t fromInput=kFALSE) const
Fills the argument arrays with the real and imaginary parts of the computed transform.
virtual Double_t * GetPointsReal(Bool_t fromInput=kFALSE) const
Returns the input array// One of the interface classes to the FFTW package, can be used directly or v...
virtual void GetPoints(Double_t *data, Bool_t fromInput=kFALSE) const
Fills the array data with the computed transform.
virtual void Transform()
Computes the transform, specified in Init() function.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void SetPoint(Int_t ipoint, Double_t re, Double_t im=0)
Set the point #ipoint.
virtual void Init(Option_t *flags, Int_t, const Int_t *)
Creates the fftw-plan.
ClassImp(TFFTRealComplex) TFFTRealComplex
default
virtual void SetPoints(const Double_t *data)
Set all input points.
UInt_t MapFlag(Option_t *flag)
allowed options: "ES" "M" "P" "EX"
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual void GetPointComplex(Int_t ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const
Returns the point #ipoint.
virtual void SetPointsComplex(const Double_t *re, const Double_t *im)
Set all points. Only the real array is used.
virtual void SetPointComplex(Int_t ipoint, TComplex &c)
Sets the point #ipoint (only the real part of the argument is taken)
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.