Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
wavecomplex.hh
Go to the documentation of this file.
1 /**********************************************************
2  * Package: Wavelet Analysis Tool
3  * this class defines complex numbers
4  * File name: wavecomplex.h
5  **********************************************************/
6 
7 #ifndef WAVECOMPLEX_HH
8 #define WAVECOMPLEX_HH
9 
10 #include <stdio.h>
11 #include <math.h>
12 #include "Rtypes.h" // used by THtml doc
13 
15 {
16 
17  public:
18 
19  wavecomplex(double,double); // Constructor
20 
21  wavecomplex(); // Default constructor
22 
23  wavecomplex(const wavecomplex&); // copy Constructor
24 
25  virtual ~wavecomplex(); // Destructor
26 
27 // operators
28 
30  virtual wavecomplex& operator+=(const wavecomplex &);
31  virtual wavecomplex& operator-=(const wavecomplex &);
32  virtual wavecomplex& operator*=(const wavecomplex &);
33  virtual wavecomplex& operator/=(const wavecomplex &);
34  virtual wavecomplex operator+ (const wavecomplex &);
35  virtual wavecomplex operator- (const wavecomplex &);
36  virtual wavecomplex operator* (const wavecomplex &);
37  virtual wavecomplex operator/ (const wavecomplex &);
38 
39  wavecomplex& operator= (const double);
40  virtual wavecomplex& operator+=(const double);
41  virtual wavecomplex& operator-=(const double);
42  virtual wavecomplex& operator*=(const double);
43  virtual wavecomplex& operator/=(const double);
44  virtual wavecomplex operator+ (const double);
45  virtual wavecomplex operator- (const double);
46  virtual wavecomplex operator* (const double);
47  virtual wavecomplex operator/ (const double);
48 
49 // member functions
50 
51  inline double real() const { return re; }
52  inline double imag() const { return im; }
53  inline double arg() const { return atan2(im,re); }
54  inline double abs() const { return re*re+im*im; }
55  inline double mod() const { return sqrt(re*re+im*im); }
56  inline void set(double x, double y) { re=x; im=y; return; }
57  inline wavecomplex conj() { wavecomplex z(re,-im); return z; }
58 
59 // private:
60 
61  double re; // real
62  double im; // imagenary
63 
64  // used by THtml doc
65  ClassDef(wavecomplex,1)
66 };
67 
68 #endif // WAVECOMPLEX_HH
double imag() const
Definition: wavecomplex.hh:52
virtual wavecomplex operator/(const wavecomplex &)
Definition: wavecomplex.cc:58
wavearray< double > z
Definition: Test10.C:32
wavecomplex conj()
Definition: wavecomplex.hh:57
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\t layers : "<< nLAYERS<< "\t dF(hz) : "<< dF<< "\t dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1)*itime+ifreq;double time=itime *dT;double freq=(ifreq >0)?ifreq *dF:dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
virtual wavecomplex operator+(const wavecomplex &)
Definition: wavecomplex.cc:52
wavecomplex & operator=(const wavecomplex &)
Definition: wavecomplex.cc:29
double real() const
Definition: wavecomplex.hh:51
virtual ~wavecomplex()
Definition: wavecomplex.cc:26
virtual wavecomplex & operator*=(const wavecomplex &)
Definition: wavecomplex.cc:36
virtual wavecomplex & operator-=(const wavecomplex &)
Definition: wavecomplex.cc:34
virtual wavecomplex operator-(const wavecomplex &)
Definition: wavecomplex.cc:54
void set(double x, double y)
Definition: wavecomplex.hh:56
double arg() const
Definition: wavecomplex.hh:53
virtual wavecomplex & operator/=(const wavecomplex &)
Definition: wavecomplex.cc:43
double abs() const
Definition: wavecomplex.hh:54
virtual wavecomplex & operator+=(const wavecomplex &)
Definition: wavecomplex.cc:32
virtual wavecomplex operator*(const wavecomplex &)
Definition: wavecomplex.cc:56
wavearray< double > y
Definition: Test10.C:31
double mod() const
Definition: wavecomplex.hh:55