[765] | 1 | #ifndef FFTWServer_H_SEEN
|
---|
| 2 | #define FFTWServer_H_SEEN
|
---|
| 3 |
|
---|
| 4 | #include "machdefs.h"
|
---|
[3000] | 5 | #include "sspvflags.h"
|
---|
[765] | 6 | #include "fftservintf.h"
|
---|
| 7 |
|
---|
| 8 |
|
---|
[1405] | 9 | // Classe implementant l'interface FFTServerInterface en
|
---|
| 10 | // utilisant FFTW
|
---|
[765] | 11 |
|
---|
[1405] | 12 | namespace SOPHYA {
|
---|
| 13 |
|
---|
[3000] | 14 | #ifdef FFTW_V2_EXTSOP
|
---|
[765] | 15 | class FFTWServerPlan;
|
---|
[3000] | 16 | #endif
|
---|
[765] | 17 |
|
---|
| 18 | class FFTWServer : public FFTServerInterface {
|
---|
| 19 | public:
|
---|
[3000] | 20 | FFTWServer(bool preserve_input=true);
|
---|
[765] | 21 | virtual ~FFTWServer();
|
---|
| 22 |
|
---|
| 23 |
|
---|
| 24 | virtual FFTServerInterface * Clone();
|
---|
| 25 |
|
---|
[3359] | 26 | // Transforme unidimensionnelle , N-dimensionnel (double precision - r_8)
|
---|
[3000] | 27 | virtual void FFTForward(TArray< complex<r_8> > & in, TArray< complex<r_8> > & out);
|
---|
| 28 | virtual void FFTBackward(TArray< complex<r_8> > & in, TArray< complex<r_8> > & out);
|
---|
| 29 | virtual void FFTForward(TArray< r_8 > & in, TArray< complex<r_8> > & out);
|
---|
| 30 | virtual void FFTBackward(TArray< complex<r_8> > & in, TArray< r_8 > & out,
|
---|
[1403] | 31 | bool usoutsz=false);
|
---|
[765] | 32 |
|
---|
[3359] | 33 | // Methodes statiques pour reordonner les donnees en 1-D (double precision - r_8)
|
---|
[2989] | 34 | static void ReShapetoReal(TArray< complex<r_8> > const & in, TArray< r_8 > & out, bool usz);
|
---|
[1403] | 35 | static void ReShapetoCompl(TArray< r_8 > const & in, TArray< complex<r_8> > & out);
|
---|
[765] | 36 |
|
---|
[3359] | 37 | #ifdef ALSO_FFTW_FLOAT_EXTSOP
|
---|
| 38 | /* ---------------------------------------------------------------------------
|
---|
| 39 | Declare and compile single precision (float) version of FFTWServr methods
|
---|
| 40 | Needs the libfftw3f.a , in addition to libfftw3.a
|
---|
| 41 | --------------------------------------------------------------------------- */
|
---|
| 42 |
|
---|
| 43 | // Transforme unidimensionnelle , N-dimensionnel (single precision - r_4)
|
---|
| 44 | virtual void FFTForward(TArray< complex<r_4> > & in, TArray< complex<r_4> > & out);
|
---|
| 45 | virtual void FFTBackward(TArray< complex<r_4> > & in, TArray< complex<r_4> > & out);
|
---|
| 46 | virtual void FFTForward(TArray< r_4 > & in, TArray< complex<r_4> > & out);
|
---|
| 47 | virtual void FFTBackward(TArray< complex<r_4> > & in, TArray< r_4 > & out,
|
---|
| 48 | bool usoutsz=false);
|
---|
| 49 |
|
---|
| 50 | // Methodes statiques pour reordonner les donnees en 1-D (single precision - r_4)
|
---|
| 51 | static void ReShapetoReal(TArray< complex<r_4> > const & in, TArray< r_4 > & out, bool usz);
|
---|
| 52 | static void ReShapetoCompl(TArray< r_4 > const & in, TArray< complex<r_4> > & out);
|
---|
| 53 |
|
---|
| 54 | #endif
|
---|
| 55 |
|
---|
[765] | 56 | protected:
|
---|
[3359] | 57 |
|
---|
| 58 | #ifndef FFTW_V2_EXTSOP
|
---|
| 59 | /* For FFTW >= V3 */
|
---|
| 60 | FFTArrayChecker<r_8> ckR8;
|
---|
| 61 | FFTArrayChecker<r_4> ckR4;
|
---|
| 62 | bool _preserve_input; // if true, input arrays not overwritten
|
---|
| 63 |
|
---|
| 64 | #else
|
---|
| 65 | /* For FFTW V2 */
|
---|
[765] | 66 | FFTWServerPlan * _p1df;
|
---|
| 67 | FFTWServerPlan * _p1db;
|
---|
[1391] | 68 | FFTWServerPlan * _pndf;
|
---|
| 69 | FFTWServerPlan * _pndb;
|
---|
[765] | 70 |
|
---|
| 71 | FFTWServerPlan * _p1drf;
|
---|
| 72 | FFTWServerPlan * _p1drb;
|
---|
[1391] | 73 | FFTWServerPlan * _pndrf;
|
---|
| 74 | FFTWServerPlan * _pndrb;
|
---|
[3359] | 75 |
|
---|
[1391] | 76 | FFTArrayChecker<r_8> ckR8;
|
---|
[3000] | 77 | bool _preserve_input; // if true, input arrays not overwritten
|
---|
[3359] | 78 |
|
---|
| 79 | #endif
|
---|
[765] | 80 | };
|
---|
| 81 |
|
---|
[1405] | 82 | } // Fin du namespace
|
---|
| 83 |
|
---|
[765] | 84 | #endif
|
---|