Logo ROOT  
Reference Guide
TFFTComplex.h
Go to the documentation of this file.
1// @(#)root/fft:$Id$
2// Author: Anna Kreshuk 07/4/2006
3
4/*************************************************************************
5 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TFFTComplex
13#define ROOT_TFFTComplex
14
15#include "TVirtualFFT.h"
16#include "TString.h"
17
18class TComplex;
19
20class TFFTComplex : public TVirtualFFT{
21protected:
22 void *fIn; //input array
23 void *fOut; //output array
24 void *fPlan; //fftw plan (the plan how to compute the transform)
25 Int_t fNdim; //number of dimensions
26 Int_t fTotalSize; //total size of the transform
27 Int_t *fN; //transform sizes in each dimension
28 Int_t fSign; //sign of the exponent of the transform (-1 is FFTW_FORWARD and +1 FFTW_BACKWARD)
29 TString fFlags; //transform flags
30
31 UInt_t MapFlag(Option_t *flag);
32
33public:
35 TFFTComplex(Int_t n, Bool_t inPlace);
36 TFFTComplex(Int_t ndim, Int_t *n, Bool_t inPlace = kFALSE);
37 virtual ~TFFTComplex();
38
39 virtual void Init(Option_t *flags, Int_t sign, const Int_t* /*kind*/);
40
41 virtual Int_t *GetN() const {return fN;}
42 virtual Int_t GetNdim() const {return fNdim;}
43 virtual Int_t GetSize() const {return fTotalSize;}
44 virtual Option_t *GetType() const {if (fSign==-1) return "C2CBackward"; else return "C2CForward";}
45 virtual Int_t GetSign() const {return fSign;}
46 virtual Option_t *GetTransformFlag() const {return fFlags;}
47 virtual Bool_t IsInplace() const {if (fOut) return kTRUE; else return kFALSE;};
48
49 virtual void GetPoints(Double_t *data, Bool_t fromInput = kFALSE) const;
50 virtual Double_t GetPointReal(Int_t /*ipoint*/, Bool_t /*fromInput = kFALSE*/) const {return 0;};
51 virtual Double_t GetPointReal(const Int_t* /*ipoint*/, Bool_t /*fromInput=kFALSE*/) const{return 0;}
52 virtual void GetPointComplex(Int_t ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const;
53 virtual void GetPointComplex(const Int_t *ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const;
54 virtual Double_t* GetPointsReal(Bool_t /*fromInput=kFALSE*/) const {return 0;};
55 virtual void GetPointsComplex(Double_t *re, Double_t *im, Bool_t fromInput = kFALSE) const ;
56 virtual void GetPointsComplex(Double_t *data, Bool_t fromInput = kFALSE) const ;
57
58 virtual void SetPoint(Int_t ipoint, Double_t re, Double_t im = 0);
59 virtual void SetPoint(const Int_t *ipoint, Double_t re, Double_t im = 0);
60 virtual void SetPoints(const Double_t *data);
61 virtual void SetPointComplex(Int_t ipoint, TComplex &c);
62 virtual void SetPointsComplex(const Double_t *re, const Double_t *im);
63 virtual void Transform();
64
66};
67
68#endif
#define c(i)
Definition: RSha256.hxx:101
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
One of the interface classes to the FFTW package, can be used directly or via the TVirtualFFT class.
Definition: TFFTComplex.h:20
virtual Int_t GetNdim() const
Definition: TFFTComplex.h:42
virtual void SetPointsComplex(const Double_t *re, const Double_t *im)
set all points. the values are copied
Int_t fTotalSize
Definition: TFFTComplex.h:26
void * fPlan
Definition: TFFTComplex.h:24
UInt_t MapFlag(Option_t *flag)
allowed options:
virtual Int_t GetSign() const
Definition: TFFTComplex.h:45
virtual void SetPoint(Int_t ipoint, Double_t re, Double_t im=0)
sets real and imaginary parts of point # ipoint
virtual Double_t GetPointReal(const Int_t *, Bool_t) const
Definition: TFFTComplex.h:51
virtual Double_t * GetPointsReal(Bool_t) const
Definition: TFFTComplex.h:54
Int_t fSign
Definition: TFFTComplex.h:28
virtual void Init(Option_t *flags, Int_t sign, const Int_t *)
Creates the fftw-plan.
virtual void SetPoints(const Double_t *data)
set all points.
virtual Option_t * GetTransformFlag() const
Definition: TFFTComplex.h:46
Int_t fNdim
Definition: TFFTComplex.h:25
virtual void GetPointComplex(Int_t ipoint, Double_t &re, Double_t &im, Bool_t fromInput=kFALSE) const
returns real and imaginary parts of the point #ipoint
TString fFlags
Definition: TFFTComplex.h:29
virtual Double_t GetPointReal(Int_t, Bool_t) const
Definition: TFFTComplex.h:50
virtual void SetPointComplex(Int_t ipoint, TComplex &c)
virtual ~TFFTComplex()
Destroys the data arrays and the plan.
TFFTComplex()
default
Definition: TFFTComplex.cxx:52
void * fOut
Definition: TFFTComplex.h:23
virtual Int_t GetSize() const
Definition: TFFTComplex.h:43
Int_t * fN
Definition: TFFTComplex.h:27
virtual void Transform()
Computes the transform, specified in Init() function.
virtual void GetPointsComplex(Double_t *re, Double_t *im, Bool_t fromInput=kFALSE) const
Copies real and imaginary parts of the output (input) into the argument arrays.
virtual Int_t * GetN() const
Definition: TFFTComplex.h:41
void * fIn
Definition: TFFTComplex.h:22
virtual void GetPoints(Double_t *data, Bool_t fromInput=kFALSE) const
Copies the output(or input) into the argument array.
virtual Bool_t IsInplace() const
Definition: TFFTComplex.h:47
virtual Option_t * GetType() const
Definition: TFFTComplex.h:44
Basic string class.
Definition: TString.h:131
TVirtualFFT is an interface class for Fast Fourier Transforms.
Definition: TVirtualFFT.h:88
const Int_t n
Definition: legend1.C:16