C++ main module for emicrom Package  1.0
MATH_MultiLevelsFFTToeplitzMatrix.h
Go to the documentation of this file.
1 #ifndef MATH_MultiLevelsFFTToeplitzMatrix_H
2 #define MATH_MultiLevelsFFTToeplitzMatrix_H
3 
5 
23 
26 
27 public:
28 
29 
30 private:
31 
32  mutable SP::FFTW_FFT mDFTProjector;
34 
35  //column leading dimensions in the CANONICAL_SPACE values which are on first row
37 
38  //row indices in the CANONICAL_SPACE values which are o the first column
40 
41 
42  // ASSOCIATIONS
43 
44 
45 
46 
47 protected:
48 
49  // METHOD
50 
51  // CONSTRUCTORS
52 
56 
57 
58 
59  // DESTRUCTORS
60 
61 
65 
66 
67 public:
68 
69 
70 
71 
72 
73 
74 public:
75 
76 
77 
78 
82  virtual void copy(const MATH_MultiLevelsToeplitzMatrix& mat);
83 
84 
85  // SET methods
86 
90  virtual void clear();
91 
92 protected:
93 
97  inline void setSpectralSpaceSize(const tUIndex& n) {
98  mSpectralSpaceSize=n;
99  }
100 
101 public:
102 
103 
104  // GET methods
113  virtual tULLInt getMemorySize() const {
115  ((mDFTProjector.get()==null)?0:mDFTProjector->getMemorySize())+
116  mColumnLeadingDimensions.getMemorySize()+
117  mRowLeadingDimensions.getMemorySize();
118 
119 
120  }
121 
125  inline FFTW_FFT& getDFTProjector() const {
126  return *mDFTProjector.get();
127  }
128 
129 
130 
131 
132 
133 
134 
135 
136 
137  // GET methods
138 
139 
140 
141 protected:
149  }
157  }
158 
159 
166  return mRowLeadingDimensions;
167  }
168 
175  return mRowLeadingDimensions;
176  }
177 
178 
182  inline const tUIndex& getSpectralSpaceSize() const {
183  return mSpectralSpaceSize;
184  }
185 
186 
187  // diagonalization methods
188  //=========================
189 protected:
194  virtual void buildSpectralVectorProjector(FFTW_FFT& proj) const {
195  proj.copy(getDFT());
196  }
197 
202  virtual void buildSpectralSpace()=0;
203 
206  virtual void recoverCanonicalSpace()=0;
207 
212  virtual void buildColumnLeadingDimensions()=0;
213 
218  virtual void buildRowLeadingDimensions()=0;
219 
220 
221 
222 
223 protected:
231  virtual void diagonalize();
232 
233 
239  virtual void recover();
240 
241 
242 
243 
244 
245 
246 
247  //product in spectral space methods
248  //==================================
249 
250 public:
251 
252 
265  virtual void vectorProduct(const tUIndex& N,
266  const tReal* X,
267  tReal* Y) const;
268 
280  virtual void vectorProduct(const CORE_RealArray& X,
281  CORE_RealArray& Y) const {
283  }
284 
285 
286 protected:
287 
294  virtual void vectorProductInSpectralSpace(const FFTW_FFT& A,FFTW_FFT& Z) const=0;
295 
300  virtual void projectIntoSpectralSpace(const tUIndex& N,const tReal* X) const=0;
301 
306  virtual void recoverFromSpectralSpace(const tUIndex& N,tReal* X) const=0;
307 
308 
309 
310 
311 
312 
313 };
314 #endif
DEFINE_SPTR(MATH_MultiLevelsFFTToeplitzMatrix)
virtual void vectorProductInSpectralSpace(const FFTW_FFT &A, FFTW_FFT &Z) const =0
make the vector product in spectral space
virtual void vectorProduct(const tUIndex &N, const tReal *X, tReal *Y) const
do the vector product of the circular matrix C with Y by an FFT method
Definition: MATH_MultiLevelsFFTToeplitzMatrix.cpp:67
const tUIndex & getSpectralSpaceSize() const
get the spectral space size
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:182
This class is multi level toeplitz matrix whose product with vector is based on FFT; It delas with th...
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:24
MATH_MultiLevelsFFTToeplitzMatrix(void)
create a multi level toeplitz matrix
Definition: MATH_MultiLevelsFFTToeplitzMatrix.cpp:3
virtual ~MATH_MultiLevelsFFTToeplitzMatrix(void)
destroy a multi level toeplitz matrix
Definition: MATH_MultiLevelsFFTToeplitzMatrix.cpp:9
SP_OBJECT(MATH_MultiLevelsFFTToeplitzMatrix)
This class manages the execution of Fast Fourier Transform. several fast Fourier Transforms may be ap...
Definition: FFTW_FFT.h:28
This class is multi levels toeplitz matrix. The matrix at level k is composed by toeplitz block matr...
Definition: MATH_MultiLevelsToeplitzMatrix.h:57
virtual void recoverCanonicalSpace()=0
recover the canonical space from the spectral space
#define null
Definition: types.h:144
virtual void recoverFromSpectralSpace(const tUIndex &N, tReal *X) const =0
recover from multi levels space to the initial space
virtual void recover()
projection of the matrix in the CANONICAL SPACE
Definition: MATH_MultiLevelsFFTToeplitzMatrix.cpp:54
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:113
virtual void projectIntoSpectralSpace(const tUIndex &N, const tReal *X) const =0
project the vector X from initial space to multi levels space
CORE_UIndexArray & getColumnLeadingDimensions()
get the leading dimension of columns from the spectral space
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:155
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: MATH_MultiLevelsToeplitzMatrix.h:267
virtual void copy(const FFTW_FFT &c)
copy the MultiDFTs
Definition: FFTW_FFT.cpp:20
virtual void buildRowLeadingDimensions()=0
build the row indices
const FFTW_FFT & getDFT() const
get the FFT class
Definition: MATH_MultiLevelsToeplitzMatrix.h:276
const CORE_UIndexArray & getRowLeadingDimensions() const
get the index of the row i and column 0 from the spectral space
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:165
virtual void copy(const MATH_MultiLevelsToeplitzMatrix &mat)
copy the instance
Definition: MATH_MultiLevelsFFTToeplitzMatrix.cpp:21
CORE_UIndexArray mRowLeadingDimensions
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:39
virtual void buildColumnLeadingDimensions()=0
build the column leading dimensions
virtual void vectorProduct(const CORE_RealArray &X, CORE_RealArray &Y) const
do the vector product of the circular matrix C with Y by an FFT method
Definition: MATH_MultiLevelsToeplitzMatrix.h:544
virtual tULLInt getMemorySize() const
return the memory size in byte
Definition: CORE_Array.h:545
const CORE_UIndexArray & getColumnLeadingDimensions() const
get the leading dimension of columns from the spectral space
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:147
#define tUIndex
Definition: types.h:126
virtual void vectorProduct(const CORE_RealArray &X, CORE_RealArray &Y) const
do the vector product of the circular matrix C with Y by an FFT method
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:280
CORE_UIndexArray mColumnLeadingDimensions
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:36
virtual void buildSpectralSpace()=0
build the spectral space
virtual void clear()
clear the matrix clear the data creating when building the spectral space
Definition: MATH_MultiLevelsFFTToeplitzMatrix.cpp:12
#define tULLInt
Definition: types.h:45
void setSpectralSpaceSize(const tUIndex &n)
set the spectral space size
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:97
virtual void buildSpectralVectorProjector(FFTW_FFT &proj) const
build the projector of vector in spectral space
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:194
FFTW_FFT & getDFTProjector() const
return the projector for vector into the spectral space
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:125
#define tReal
Definition: types.h:118
SP::FFTW_FFT mDFTProjector
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:32
tUIndex mSpectralSpaceSize
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:33
CORE_UIndexArray & getRowLeadingDimensions()
get the index of the row i and column 0 from the spectral space
Definition: MATH_MultiLevelsFFTToeplitzMatrix.h:174
virtual void diagonalize()
diagonalize the matrix projection of the matrix in the SPECTRAL_SPACE
Definition: MATH_MultiLevelsFFTToeplitzMatrix.cpp:34