7 template <class Record>
9 { recSize =
sizeof(Record);
10 SizeSSE = ((2*n+1)*recSize/16+1)*16;
15 template <
class Record>
21 template <
class Record>
25 for(
int i=0;
i<SizeSSE/recSize; ++
i)rec[
i] = other.
rec[
i];
29 template <
class Record>
34 template <
class Record>
37 int newSizeSSE = ((2*nn+1)*recSize/16+1)*16;
38 if(newSizeSSE==SizeSSE)
return;
45 template <
class Record>
48 if(posix_memalign((
void**)&rec, 16, SizeSSE))
49 printf(
"SymmArraySSE::SymmArraySSE : memory not allocated\n");
50 zero = rec + SizeSSE/(2*recSize);
55 template <
class Record>
57 {
int n = SizeSSE/recSize;
58 for(
int i=-n/2;
i<-last; ++
i)zero[
i] = 0;
59 for(
int i=last+1;
i<n/2; ++
i)zero[
i] = 0;
63 template <
class Record>
65 { fwrite(&last,
sizeof(
int), 1, f);
66 fwrite(&recSize,
sizeof(
int), 1, f);
67 fwrite(rec, recSize, 2*last+1, f);
70 template <
class Record>
73 fread(&n,
sizeof(
int), 1, f);
74 fread(&newRecSz,
sizeof(
int), 1, f);
76 if(newRecSz!=recSize){
77 printf(
"Array::Read abort b/c different record size: %d vs %d\n", newRecSz,recSize);
81 int newSizeSSE = ((2*n+1)*recSize/16+1)*16;
84 if(newSizeSSE != SizeSSE){
89 fread(rec, recSize, 2*n+1, f);
92 template <
class Record>
94 {
for(
int i=0;
i<2*last+1; ++
i)rec[
i] = x;
SymmArraySSE(unsigned int n=0)
printf("total live time: non-zero lags = %10.1f \n", liveTot)
wavearray< double > a(hp.size())
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
int recSize
always in the middle of the allocated space
SymmArraySSE & operator=(const SymmArraySSE &other)