| [1371] | 1 | //   FFT (Fast Fourier Transform) Server based on FFTPack
 | 
|---|
 | 2 | //        R. Ansari     1999-2000
 | 
|---|
 | 3 | // DAPNIA/SPP (Saclay) / CEA    LAL - IN2P3/CNRS  (Orsay)
 | 
|---|
 | 4 | 
 | 
|---|
| [710] | 5 | #ifndef  FFTPServer_H_SEEN
 | 
|---|
 | 6 | #define  FFTPServer_H_SEEN
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | #include "fftservintf.h"
 | 
|---|
 | 9 | 
 | 
|---|
 | 10 | // implementation de FFTServerInterface en utilisant FFTPack 
 | 
|---|
 | 11 | 
 | 
|---|
 | 12 | namespace SOPHYA {
 | 
|---|
 | 13 | 
 | 
|---|
| [896] | 14 | //! An FFT server based on fftpack.
 | 
|---|
| [710] | 15 | class FFTPackServer : public FFTServerInterface {
 | 
|---|
 | 16 |  public:
 | 
|---|
| [3002] | 17 |   FFTPackServer(bool preserve_input=true);
 | 
|---|
| [710] | 18 |   virtual ~FFTPackServer();
 | 
|---|
 | 19 | 
 | 
|---|
 | 20 |   // Implementation de l'interface FFTServerInterface
 | 
|---|
 | 21 | 
 | 
|---|
 | 22 |   virtual FFTServerInterface * Clone();
 | 
|---|
 | 23 | 
 | 
|---|
| [717] | 24 |   // Transforme unidimensionnel sur des double
 | 
|---|
| [3002] | 25 |   virtual void FFTForward(TArray< complex<r_8> > & in, TArray< complex<r_8> > & out);
 | 
|---|
 | 26 |   virtual void FFTBackward(TArray< complex<r_8> > & in, TArray< complex<r_8> > & out);
 | 
|---|
 | 27 |   virtual void FFTForward(TArray< r_8 > & in, TArray< complex<r_8> > & out);
 | 
|---|
 | 28 |   virtual void FFTBackward(TArray< complex<r_8> > & in, TArray< r_8 > & out, 
 | 
|---|
| [1402] | 29 |                            bool usoutsz=false);
 | 
|---|
| [710] | 30 | 
 | 
|---|
| [717] | 31 |   // Transforme unidimensionnel sur des float
 | 
|---|
| [3002] | 32 |   virtual void FFTForward(TArray< complex<r_4> > & in, TArray< complex<r_4> > & out);
 | 
|---|
 | 33 |   virtual void FFTBackward(TArray< complex<r_4> > & in, TArray< complex<r_4> > & out);
 | 
|---|
 | 34 |   virtual void FFTForward(TArray< r_4 > & in, TArray< complex<r_4> > & out);
 | 
|---|
 | 35 |   virtual void FFTBackward(TArray< complex<r_4> > & in, TArray< r_4 > & out,
 | 
|---|
| [1402] | 36 |                            bool usoutsz=false);
 | 
|---|
| [710] | 37 | 
 | 
|---|
| [1394] | 38 | // Methodes statiques pour reordonner les donnees
 | 
|---|
| [2988] | 39 |   static void ReShapetoReal(TArray< complex<r_8> > const & in, TArray< r_8 >  & out, bool usz);
 | 
|---|
| [1394] | 40 |   static void ReShapetoCompl(TArray< r_8 > const & in, TArray< complex<r_8> > & out); 
 | 
|---|
| [2988] | 41 |   static void ReShapetoReal(TArray< complex<r_4> > const & in, TArray< r_4 >  & out, bool usz);
 | 
|---|
| [1394] | 42 |   static void ReShapetoCompl(TArray< r_4 > const & in, TArray< complex<r_4> > & out); 
 | 
|---|
 | 43 | 
 | 
|---|
| [710] | 44 |   //  Methodes propres a cette classe
 | 
|---|
| [791] | 45 |   virtual void fftf(int_4 l, float* inout);
 | 
|---|
 | 46 |   virtual void fftb(int_4 l, float* inout);
 | 
|---|
 | 47 |   virtual void fftf(int_4 l, double* inout);
 | 
|---|
 | 48 |   virtual void fftb(int_4 l, double* inout);
 | 
|---|
 | 49 |   virtual void fftf(int_4 l, complex<float>* inout);
 | 
|---|
 | 50 |   virtual void fftb(int_4 l, complex<float>* inout);
 | 
|---|
 | 51 |   virtual void fftf(int_4 l, complex<double>* inout);
 | 
|---|
 | 52 |   virtual void fftb(int_4 l, complex<double>* inout);
 | 
|---|
| [710] | 53 | 
 | 
|---|
 | 54 |  protected:
 | 
|---|
| [791] | 55 |   virtual void checkint_rfft(int_4 l);
 | 
|---|
 | 56 |   virtual void checkint_dfft(int_4 l);
 | 
|---|
 | 57 |   virtual void checkint_cfft(int_4 l);
 | 
|---|
 | 58 |   virtual void checkint_cdfft(int_4 l);
 | 
|---|
| [710] | 59 | 
 | 
|---|
 | 60 |   int sz_rfft;
 | 
|---|
| [791] | 61 |   r_4* ws_rfft;
 | 
|---|
| [710] | 62 | 
 | 
|---|
 | 63 |   int sz_cfft;
 | 
|---|
| [791] | 64 |   r_4* ws_cfft;
 | 
|---|
| [710] | 65 | 
 | 
|---|
 | 66 |   int sz_dfft;
 | 
|---|
| [791] | 67 |   r_8* ws_dfft;
 | 
|---|
| [710] | 68 | 
 | 
|---|
 | 69 |   int sz_cdfft;
 | 
|---|
| [791] | 70 |   r_8* ws_cdfft;
 | 
|---|
| [1390] | 71 | 
 | 
|---|
 | 72 |   FFTArrayChecker<r_4> ckR4;
 | 
|---|
 | 73 |   FFTArrayChecker<r_8> ckR8;
 | 
|---|
| [3002] | 74 |   bool _preserve_input; // if true, input arrays not overwritten
 | 
|---|
 | 75 | 
 | 
|---|
| [710] | 76 | };
 | 
|---|
 | 77 | 
 | 
|---|
 | 78 | } // Fin du namespace
 | 
|---|
 | 79 | 
 | 
|---|
 | 80 | 
 | 
|---|
 | 81 | #endif
 | 
|---|