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

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

Modifs FFTServerInterface + FFTPackServer (Suite - Fin ?) - Reza 13/2/2001

File size: 2.5 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);
[1402]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 bool usoutsz=false);
[710]40
[1390]41 // Transforme N-dim sur des float
42 virtual void FFTForward(TArray< complex<r_4> > const & in, TArray< complex<r_4> > & out);
43 virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< complex<r_4> > & out);
44 virtual void FFTForward(TArray< r_4 > const & in, TArray< complex<r_4> > & out);
[1402]45 virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< r_4 > & out,
46 bool usoutsz=false);
[710]47
48 protected:
[1402]49
[710]50 bool _fgnorm;
51 string _info;
[1402]52
[710]53};
54
55} // Fin du namespace
56
[1390]57template <class T>
58class FFTArrayChecker {
59public:
[1400]60 FFTArrayChecker(string msg, bool checkpack=true,
61 bool onedonly=false);
[1390]62 virtual ~FFTArrayChecker();
[1394]63 static T ZeroThreshold();
[1402]64
65 inline void SetMsg(string const & msg) { _msg = msg; }
66 inline void CheckPackedArray(bool ck=true) { _checkpack = ck; }
67 inline void Accept1DOnly(bool ac1d=false) { _onedonly = ac1d; }
68
[1390]69 virtual int CheckResize(TArray< complex<T> > const & in, TArray< complex<T> > & out);
70 virtual int CheckResize(TArray< T > const & in, TArray< complex<T> > & out);
[1402]71 virtual int CheckResize(TArray< complex<T> > const & in, TArray< T > & out,
72 bool usoutsz=false);
[1390]73
74protected:
[1394]75 string _msg;
[1390]76 bool _checkpack;
77 bool _onedonly;
[1402]78
[1390]79};
80
[710]81#endif
Note: See TracBrowser for help on using the repository browser.