Logo coherent WaveBurst  
Library Reference Guide
Logo
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SymmArraySSE.hh
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Sergey Klimenko, Valentin Necula
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 SYMMARRAYSSE_HH
20 #define SYMMARRAYSSE_HH
21 
22 #include "stdio.h"
23 #include "TNamed.h"
24 
25 // meant to be used with int32, int64, float, double
26 
27 // a[-n], a[-n+1] a[-n+2] ... a[0] a[1] .... a[n]
28 
29 template <class Record>
30 class SymmArraySSE : public TNamed{
31 public:
32  SymmArraySSE(unsigned int n=0);
33  SymmArraySSE(const SymmArraySSE&); //copy constructor
34  virtual ~SymmArraySSE();
35  SymmArraySSE& operator=(const SymmArraySSE& other);
36  void Init(Record x);
37  void Resize(int nn); // new n
38  void Write(FILE* f);
39  void Read(FILE* f);
40  Record& operator[](int i){ return zero[i];}
41  Record* SSEPointer(){ return rec;}
42  int SSESize(){ return SizeSSE;}
43  int Last() {return last;}
44  void ZeroExtraElements();
45 
46 protected:
47  void allocateSSE(); // aligned allocation; uses SizeSSE, last; sets rec, zero
48  int last, SizeSSE; // SizeSSE in bytes (multiple of 8)
49  Record* rec; //!
50  Record* zero; //! always in the middle of the allocated space
51  int recSize;
52 
53  ClassDef(SymmArraySSE,1)
54 };
55 
56 
57 
58 #endif
Record * zero
Definition: SymmArraySSE.hh:50
SymmArraySSE(unsigned int n=0)
Definition: SymmArraySSE.cc:26
void allocateSSE()
Definition: SymmArraySSE.cc:64
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
void Write(FILE *f)
Definition: SymmArraySSE.cc:82
Record * SSEPointer()
Definition: SymmArraySSE.hh:41
i drho i
cout<< "SNR "<< xsnr<< endl;wavearray< double > f
Definition: ComputeSNR.C:75
Record * rec
Definition: SymmArraySSE.hh:49
int recSize
always in the middle of the allocated space
Definition: SymmArraySSE.hh:51
SymmArraySSE & operator=(const SymmArraySSE &other)
Definition: SymmArraySSE.cc:40
Record & operator[](int i)
Definition: SymmArraySSE.hh:40
void Resize(int nn)
Definition: SymmArraySSE.cc:53
void Read(FILE *f)
Definition: SymmArraySSE.cc:89
void Init(Record x)
virtual ~SymmArraySSE()
Definition: SymmArraySSE.cc:48
void ZeroExtraElements()
Definition: SymmArraySSE.cc:74