Logo coherent WaveBurst  
Library Reference Guide
Logo
SymmArray.hh
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Sergey Klimenko
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 #ifndef SYMMARRAY_HH
20 #define SYMMARRAY_HH
21 
22 #include "stdio.h"
23 #include "TNamed.h"
24 
25 // guaranteed to work only with (struct of) atomic types
26 
27 // a[-n], a[-n+1] a[-n+2] ... a[0] a[1] .... a[n]
28 
29 template <class Record>
30 class SymmArray : public TNamed {
31 public:
32  SymmArray(unsigned int n=0);
33  SymmArray(const SymmArray&); //copy constructor
34  virtual ~SymmArray();
35  SymmArray& operator=(const SymmArray& other);
36  void Init(Record x);
37  void Resize(int sz);
38  void Write(FILE* f);
39  void Read(FILE* f);
40  Record& operator[](int i){ return zero[i];}
41  int Last() {return Size/2;}
42 
43 
44 protected:
45  void Resize0(int sz);
46  int Size;
47  Record* rec; //!
48  Record* zero; //!
49  int recSize;
50 
51  ClassDef(SymmArray,1)
52 };
53 
54 #endif
virtual ~SymmArray()
Definition: SymmArray.cc:51
int Size
Definition: SymmArray.hh:46
int n
Definition: cwb_net.C:28
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<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ 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
SymmArray(unsigned int n=0)
Definition: SymmArray.cc:26
i drho i
Record * rec
Definition: SymmArray.hh:47
void Resize(int sz)
Definition: SymmArray.cc:56
cout<< "SNR "<< xsnr<< endl;wavearray< double > f
Definition: ComputeSNR.C:75
void Init(Record x)
Definition: SymmArray.cc:97
Record * zero
Definition: SymmArray.hh:48
int Last()
Definition: SymmArray.hh:41
void Resize0(int sz)
Definition: SymmArray.cc:61
Record & operator[](int i)
Definition: SymmArray.hh:40
SymmArray & operator=(const SymmArray &other)
Definition: SymmArray.cc:42
void Write(FILE *f)
Definition: SymmArray.cc:70
void Read(FILE *f)
Definition: SymmArray.cc:77
int recSize
Definition: SymmArray.hh:49