[1371] | 1 | // FFT (Fast Fourier Transform) Server Interface
|
---|
| 2 | // R. Ansari 1999-2000
|
---|
| 3 | // DAPNIA/SPP (Saclay) / CEA LAL - IN2P3/CNRS (Orsay)
|
---|
| 4 |
|
---|
[710] | 5 | #ifndef FFTServerIntf_H_SEEN
|
---|
| 6 | #define FFTServerIntf_H_SEEN
|
---|
| 7 |
|
---|
| 8 | #include "machdefs.h"
|
---|
| 9 | #include "pexceptions.h"
|
---|
| 10 | #include <complex>
|
---|
| 11 | #include "tmatrix.h"
|
---|
| 12 | #include "tvector.h"
|
---|
| 13 |
|
---|
| 14 | // Classe definissant l'interface pour les transformees de Fourier
|
---|
| 15 | // L'implementation par defaut est vide et lance une exception
|
---|
| 16 |
|
---|
| 17 | namespace SOPHYA {
|
---|
| 18 |
|
---|
| 19 | class FFTServerInterface {
|
---|
| 20 | public:
|
---|
| 21 |
|
---|
| 22 | // Methodes de la classe
|
---|
| 23 | FFTServerInterface(string info);
|
---|
| 24 | virtual ~FFTServerInterface();
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | virtual FFTServerInterface * Clone() = 0;
|
---|
| 28 |
|
---|
[1405] | 29 | //! Set/clear the flag for normalizing Fourier transforms.
|
---|
[710] | 30 | inline void setNormalize(bool fg=false) { _fgnorm = fg; }
|
---|
[1405] | 31 | //! Returns the status of normalization flag for the server
|
---|
[710] | 32 | inline bool getNormalize() const { return(_fgnorm); }
|
---|
[1405] | 33 | //! Returns the information string associated with the server
|
---|
[710] | 34 | inline string getInfo() const { return _info; }
|
---|
| 35 |
|
---|
| 36 | //---------------------------------------------------
|
---|
[1390] | 37 | // Transforme N-dim sur des doubles
|
---|
| 38 | virtual void FFTForward(TArray< complex<r_8> > const & in, TArray< complex<r_8> > & out);
|
---|
| 39 | virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< complex<r_8> > & out);
|
---|
[1402] | 40 | virtual void FFTForward(TArray< r_8 > const & in, TArray< complex<r_8> > & out);
|
---|
| 41 | virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< r_8 > & out,
|
---|
| 42 | bool usoutsz=false);
|
---|
[710] | 43 |
|
---|
[1390] | 44 | // Transforme N-dim sur des float
|
---|
| 45 | virtual void FFTForward(TArray< complex<r_4> > const & in, TArray< complex<r_4> > & out);
|
---|
| 46 | virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< complex<r_4> > & out);
|
---|
| 47 | virtual void FFTForward(TArray< r_4 > const & in, TArray< complex<r_4> > & out);
|
---|
[1402] | 48 | virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< r_4 > & out,
|
---|
| 49 | bool usoutsz=false);
|
---|
[710] | 50 |
|
---|
| 51 | protected:
|
---|
[1402] | 52 |
|
---|
[710] | 53 | bool _fgnorm;
|
---|
| 54 | string _info;
|
---|
[1402] | 55 |
|
---|
[710] | 56 | };
|
---|
| 57 |
|
---|
| 58 |
|
---|
[1390] | 59 | template <class T>
|
---|
| 60 | class FFTArrayChecker {
|
---|
| 61 | public:
|
---|
[1400] | 62 | FFTArrayChecker(string msg, bool checkpack=true,
|
---|
| 63 | bool onedonly=false);
|
---|
[1390] | 64 | virtual ~FFTArrayChecker();
|
---|
[1394] | 65 | static T ZeroThreshold();
|
---|
[1402] | 66 |
|
---|
| 67 | inline void SetMsg(string const & msg) { _msg = msg; }
|
---|
| 68 | inline void CheckPackedArray(bool ck=true) { _checkpack = ck; }
|
---|
| 69 | inline void Accept1DOnly(bool ac1d=false) { _onedonly = ac1d; }
|
---|
| 70 |
|
---|
[1390] | 71 | virtual int CheckResize(TArray< complex<T> > const & in, TArray< complex<T> > & out);
|
---|
| 72 | virtual int CheckResize(TArray< T > const & in, TArray< complex<T> > & out);
|
---|
[1402] | 73 | virtual int CheckResize(TArray< complex<T> > const & in, TArray< T > & out,
|
---|
| 74 | bool usoutsz=false);
|
---|
[1390] | 75 |
|
---|
| 76 | protected:
|
---|
[1394] | 77 | string _msg;
|
---|
[1390] | 78 | bool _checkpack;
|
---|
| 79 | bool _onedonly;
|
---|
[1402] | 80 |
|
---|
[1390] | 81 | };
|
---|
| 82 |
|
---|
[1405] | 83 | } // Fin du namespace
|
---|
| 84 |
|
---|
[710] | 85 | #endif
|
---|