source: Sophya/trunk/SophyaLib/NTools/fftservintf.h@ 1400

Last change on this file since 1400 was 1400, checked in by ansari, 25 years ago

Modifs-debug FFTServerInterface FFTPackServer - Reza 13/2/2001

File size: 2.4 KB
Line 
1// FFT (Fast Fourier Transform) Server Interface
2// R. Ansari 1999-2000
3// DAPNIA/SPP (Saclay) / CEA LAL - IN2P3/CNRS (Orsay)
4
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
17namespace SOPHYA {
18
19class FFTServerInterface {
20 public:
21
22// Methodes de la classe
23 FFTServerInterface(string info);
24 virtual ~FFTServerInterface();
25
26
27 virtual FFTServerInterface * Clone() = 0;
28
29 inline void setNormalize(bool fg=false) { _fgnorm = fg; }
30 inline bool getNormalize() const { return(_fgnorm); }
31 inline string getInfo() const { return _info; }
32
33 //---------------------------------------------------
34 // Transforme N-dim sur des doubles
35 virtual void FFTForward(TArray< complex<r_8> > const & in, TArray< complex<r_8> > & out);
36 virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< complex<r_8> > & out);
37 virtual void FFTForward(TArray< r_8 > const & in, TArray< complex<r_8> > & out);
38 virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< r_8 > & out);
39
40 // Transforme N-dim sur des float
41 virtual void FFTForward(TArray< complex<r_4> > const & in, TArray< complex<r_4> > & out);
42 virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< complex<r_4> > & out);
43 virtual void FFTForward(TArray< r_4 > const & in, TArray< complex<r_4> > & out);
44 virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< r_4 > & out);
45
46 protected:
47 bool _fgnorm;
48 string _info;
49};
50
51} // Fin du namespace
52
53template <class T>
54class FFTArrayChecker {
55public:
56 FFTArrayChecker(string msg, bool checkpack=true,
57 bool onedonly=false);
58 virtual ~FFTArrayChecker();
59 static T ZeroThreshold();
60 virtual int CheckResize(TArray< complex<T> > const & in, TArray< complex<T> > & out);
61 virtual int CheckResize(TArray< T > const & in, TArray< complex<T> > & out);
62 virtual int CheckResize(TArray< complex<T> > const & in, TArray< T > & out);
63 // virtual void ReShapetoReal(TArray< complex<T> > const & in, TArray< T > & out);
64 // virtual void ReShapetoCompl(TArray< T > const & in, TArray< complex<T> > & out);
65
66protected:
67 string _msg;
68 bool _checkpack;
69 bool _onedonly;
70};
71
72#endif
Note: See TracBrowser for help on using the repository browser.