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

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

Changement interface FFTServer - Reza 12/2/2001

File size: 2.3 KB
RevLine 
[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
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 //---------------------------------------------------
[1390]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);
[710]39
[1390]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);
[710]45
46 protected:
47 bool _fgnorm;
48 string _info;
49};
50
51} // Fin du namespace
52
[1390]53template <class T>
54class FFTArrayChecker {
55public:
[1394]56 FFTArrayChecker(string msg, bool checkpack=true, bool onedonly=false);
[1390]57 virtual ~FFTArrayChecker();
[1394]58 static T ZeroThreshold();
[1390]59 virtual int CheckResize(TArray< complex<T> > const & in, TArray< complex<T> > & out);
60 virtual int CheckResize(TArray< T > const & in, TArray< complex<T> > & out);
61 virtual int CheckResize(TArray< complex<T> > const & in, TArray< T > & out);
[1394]62 // virtual void ReShapetoReal(TArray< complex<T> > const & in, TArray< T > & out);
63 // virtual void ReShapetoCompl(TArray< T > const & in, TArray< complex<T> > & out);
[1390]64
65protected:
[1394]66 string _msg;
[1390]67 bool _checkpack;
68 bool _onedonly;
69};
70
[710]71#endif
Note: See TracBrowser for help on using the repository browser.