C++ main module for emicrom Package  1.0
FFTW_FFT.h
Go to the documentation of this file.
1 #ifndef FFTW_FFT_H
2 #define FFTW_FFT_H
3 
4 #include "FFTW_Object.h"
5 
6 #include "FFTW_ComplexArray.h"
7 #include "FFTW_Plan.h"
8 
28 class FFTW_FFT : public virtual FFTW_Object {
30  // ATTRIBUTES
31 
32 public:
33 
34 
35 
36 
37 private:
38 
39  //dimension of each point
41 
42  //number of points
44 
45  //list of plans to excute FFTs
46  SV::FFTW_Plan mPlans;
47 
48  //values of size mDimension*mPointsNUmber
50 
51 protected:
52  // METHODS
53 
54  // CONSTRUCTORS
55 
58  FFTW_FFT();
59 
60 
61  // DESTRUCTORS
62 
63 
66  virtual ~FFTW_FFT(void);
67 
68 public:
69 
70  //New constructors
71 
72 
76  virtual SP::FFTW_FFT NewInstance() const=0;
77 
78 
79 public:
80  //accessor operators
81  //==================
85  inline const tFFTWComplex& operator[](const tUIndex& i) const {
86  return mValues[i];
87  }
91  inline tFFTWComplex& operator[](const tUIndex& i) {
92  return mValues[i];
93  }
94 
95  //copy operators
100  inline FFTW_FFT& operator=(const tReal& v) {
101  mValues=v;
102  return (*this);
103  }
108  inline FFTW_FFT& operator=(const tFFTWComplex& v) {
109  mValues=v;
110  return (*this);
111  }
116  inline FFTW_FFT& operator=(const FFTW_FFT& Y) {
117  copy(Y);
118  return (*this);
119  }
120 
121 
122 
123  //arithmetic operator
124 
130  inline FFTW_FFT& operator*=(const FFTW_FFT& Y) {
131  multiply(Y);
132  return (*this);
133  }
134 
135 
138  virtual void clear();
139 
143  virtual void copy(const FFTW_FFT& c);
144 
145  // SET methods
146  //============
147 
151  inline void setPointsNumber(const tUIndex& n) {
152  mPointsNumber=n;
153  mValues.setSize(n*mDimension);
154  }
155 
159  virtual void setDimension(const tUSInt& n) {
160  mDimension=n;
161  }
162 
167  virtual void setSize(const CORE_UIndexArray& levels,
168  const tUSInt& dim)=0;
169 
170 
171 
175  virtual void setFFTsNumber(const tUInt& nFFTs)=0;
176 
177 
178 
185  virtual void setFFT(const tUInt& f,
186  const tSInt& dir,
187  const tBoolean& isInverse,
188  const tBoolean& optimize)=0;
189 
190 
196  virtual void setFFT(const tUInt& f,const tSInt& dir,const tBoolean& isInverse) {
197  setFFT(f,dir,isInverse,false);
198  }
199 
204  virtual void setFFT(const tUInt& f,const tBoolean& isInverse) {
205  setFFT(f,FFTW_Plan::BACKWARD,isInverse,false);
206  }
207 
208 
209  //GET methods
210  //===========
211 
220  virtual tULLInt getMemorySize() const {
221  return mValues.getMemorySize();
222  }
223 
227  inline const FFTW_ComplexArray& getArray() const {
228  return mValues;
229  }
234  return mValues;
235  }
236 
240  inline const tFFTWComplex* getValues() const {
241  return &mValues[0];
242  }
247  return &mValues[0];
248  }
249 
253  inline const tUIndex& getValuesNumber() const {
254  return mValues.getSize();
255  }
259  inline const tUSInt& getDimension() const {
260  return mDimension;
261  }
265  inline const tUIndex& getPointsNumber() const {
266  return mPointsNumber;
267  }
272  virtual tUIndex getSize(CORE_UIndexArray& levels) const=0;
273 
274  //operators on values
275  //===================
276 
280  virtual void multiply(const FFTW_FFT& Y) {
281  mValues*=Y.getArray();
282  }
283 
287  virtual void runFFT(const tUIndex& f)=0;
288 
289 
290  //PLAN Managment methods
291  //======================
292 
293 protected:
294 
298  inline void setPlansNumber(const tUIndex& n) {
299  mPlans.setSize(n);
300  }
301 
305  inline tUIndex getPlansNumber() const {
306  return mPlans.getSize();
307  }
308 
312  inline const SV::FFTW_Plan& getPlans() const {
313  return mPlans;
314  }
318  inline SV::FFTW_Plan& getPlans() {
319  return mPlans;
320  }
321 
326  virtual void setPlan(const tUIndex& i,FFTW_Plan& p)=0;
327 
328 
329 
330 
331 };
332 
333 #endif
This class describes an FFT Plan.
Definition: FFTW_Plan.h:15
const tUIndex & getValuesNumber() const
get the number of values
Definition: FFTW_FFT.h:253
const tUSInt & getDimension() const
get the dimension of the FFT
Definition: FFTW_FFT.h:259
FFTW_FFT & operator=(const FFTW_FFT &Y)
copy the FFT
Definition: FFTW_FFT.h:116
virtual SP::FFTW_FFT NewInstance() const =0
retun a new instance of this
virtual void setDimension(const tUSInt &n)
set the dimension of a point
Definition: FFTW_FFT.h:159
virtual void setPlan(const tUIndex &i, FFTW_Plan &p)=0
create the values for the plan at index i
tFFTWComplex * getValues()
get the values of the FFT
Definition: FFTW_FFT.h:246
tUSInt mDimension
Definition: FFTW_FFT.h:40
FFTW_FFT & operator=(const tFFTWComplex &v)
init the values of the DFTs to value
Definition: FFTW_FFT.h:108
This class manages the execution of Fast Fourier Transform. several fast Fourier Transforms may be ap...
Definition: FFTW_FFT.h:28
virtual void setFFTsNumber(const tUInt &nFFTs)=0
set the number of FFTs
#define tUSInt
Definition: types.h:28
#define tBoolean
Definition: types.h:139
#define tFFTWComplex
Definition: fftw_types.h:65
virtual void runFFT(const tUIndex &f)=0
run the FFT at index f
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: FFTW_ComplexArray.h:388
virtual tUIndex getSize(CORE_UIndexArray &levels) const =0
get the size of the FFT in multi-levels form
tFFTWComplex & operator[](const tUIndex &i)
get the complex value at index i
Definition: FFTW_FFT.h:91
virtual void copy(const FFTW_FFT &c)
copy the MultiDFTs
Definition: FFTW_FFT.cpp:20
SP_OBJECT(FFTW_FFT)
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: FFTW_FFT.h:220
FFTW_ComplexArray & getArray()
get the array of values of the FFT
Definition: FFTW_FFT.h:233
#define tSInt
Definition: types.h:30
const tUIndex & getSize() const
get the size
Definition: FFTW_ComplexArray.h:406
SV::FFTW_Plan & getPlans()
get the plans of the FFT
Definition: FFTW_FFT.h:318
void setPointsNumber(const tUIndex &n)
set the number of values
Definition: FFTW_FFT.h:151
FFTW_FFT()
create a FFT object
Definition: FFTW_FFT.cpp:6
static const tSInt BACKWARD
Definition: FFTW_Object.h:27
#define tUInt
Definition: types.h:33
FFTW_FFT & operator=(const tReal &v)
init the values of the DFTs to value
Definition: FFTW_FFT.h:100
virtual ~FFTW_FFT(void)
destroy an FFT Object.
Definition: FFTW_FFT.cpp:11
void setPlansNumber(const tUIndex &n)
set the number of plans
Definition: FFTW_FFT.h:298
const tFFTWComplex * getValues() const
get the values of the FFT
Definition: FFTW_FFT.h:240
FFTW_FFT & operator*=(const FFTW_FFT &Y)
multiply two DFTs This *= Y;
Definition: FFTW_FFT.h:130
This class describes FFT complex array based on fft_complex structure.
Definition: FFTW_ComplexArray.h:17
This class is the base class of FFTW objects.
Definition: FFTW_Object.h:19
#define tUIndex
Definition: types.h:126
virtual void multiply(const FFTW_FFT &Y)
multiply this by the DFTs Y
Definition: FFTW_FFT.h:280
void setSize(const tUIndex &n)
set size of the array
Definition: FFTW_ComplexArray.h:288
const FFTW_ComplexArray & getArray() const
get the array of values of the FFT
Definition: FFTW_FFT.h:227
SV::FFTW_Plan mPlans
Definition: FFTW_FFT.h:46
const SV::FFTW_Plan & getPlans() const
get the plans of the FFT
Definition: FFTW_FFT.h:312
const tUIndex & getPointsNumber() const
get the number of points
Definition: FFTW_FFT.h:265
FFTW_ComplexArray mValues
Definition: FFTW_FFT.h:49
tUIndex mPointsNumber
Definition: FFTW_FFT.h:43
#define tULLInt
Definition: types.h:45
virtual void setFFT(const tUInt &f, const tSInt &dir, const tBoolean &isInverse)
set the FFT
Definition: FFTW_FFT.h:196
virtual void setSize(const CORE_UIndexArray &levels, const tUSInt &dim)=0
set the size of the FFT in multilevels form
tUIndex getPlansNumber() const
get the number of plans
Definition: FFTW_FFT.h:305
const tFFTWComplex & operator[](const tUIndex &i) const
get the complex value at index i
Definition: FFTW_FFT.h:85
#define tReal
Definition: types.h:118
virtual void setFFT(const tUInt &f, const tBoolean &isInverse)
set the FFT
Definition: FFTW_FFT.h:204
virtual void setFFT(const tUInt &f, const tSInt &dir, const tBoolean &isInverse, const tBoolean &optimize)=0
set the FFT
virtual void clear()
clear the FFTs
Definition: FFTW_FFT.cpp:14
DEFINE_SPTR(FFTW_FFT)