Changeset 14801
- Timestamp:
- 01/31/13 11:49:13 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/zfits.cc
r14797 r14801 160 160 161 161 // If the column is the data, preprocess the data 162 /* 162 163 if (it->second.name=="Data") 163 { /* 164 // e.g. subtract the median (note that this is just 165 // to test the properties of the compression, because 166 // it re-sorts the real data and does not keep the 167 // subtracted offset in the output 168 int n = 30; 169 vector<int16_t> med(1440*n); 170 for (int i=0; i<1440*n; i++) 164 { 165 int16_t *end = ptr+1440*300-2-300%2; 166 int16_t *beg = ptr; 167 168 while (end>=beg) 171 169 { 172 int16_t *chunk = ptr+i*300/n; 173 sort(chunk, chunk+300/n); 174 175 med[i] = chunk[300/n/2]; 176 177 for (int j=0; j<300/n; j++) 178 chunk[j] -= med[i]; 170 const int16_t avg = (end[0] + end[1])/2; 171 end[2] -= avg; 172 end[3] -= avg; 173 end -=2; 179 174 } 180 181 string buf; 182 int len = huffmans_encode(buf, (uint16_t*)med.data(), med.size()); 183 com += buf.size();*/ 184 } 175 }*/ 185 176 186 177 // do not try to compress less than 32bytes … … 234 225 { 235 226 const double elep = Time().UnixTime()-start.UnixTime(); 236 cout << "\r" << setprecision(0) << setw(3) << 100*proc << "% [" << set w(3) << 100.*com/tot << "%] cpu:" << setprecision(1)<< sec << "s in:" << tot/1000000/elep << "MB/s" << flush;227 cout << "\r" << setprecision(0) << setw(3) << 100*proc << "% [" << setprecision(1) << setw(5) << 100.*com/tot << "%] cpu:" << sec << "s in:" << tot/1000000/elep << "MB/s" << flush; 237 228 frac += 0.01; 238 229 } … … 240 231 241 232 const double elep = Time().UnixTime()-start.UnixTime(); 242 cout << setprecision(0) << "\r100% [" << set w(3) << 100.*com/tot << "%] cpu:" << setprecision(1)<< sec << "s in:" << tot/1000000/elep << "MB/s" << endl;233 cout << setprecision(0) << "\r100% [" << setprecision(1) << setw(5) << 100.*com/tot << "%] cpu:" << sec << "s in:" << tot/1000000/elep << "MB/s" << endl; 243 234 244 235 return 0; … … 393 384 { 394 385 const double elep = Time().UnixTime()-start.UnixTime(); 395 cout << "\r" << setprecision(0) << setw(3) << 100*proc << "% [" << set w(3) << 100.*com/tot << "%] cpu:" << setprecision(1)<< sec << "s out:" << tot/1000000/elep << "MB/s" << flush;386 cout << "\r" << setprecision(0) << setw(3) << 100*proc << "% [" << setprecision(1) << setw(5) << 100.*com/tot << "%] cpu:" << sec << "s out:" << tot/1000000/elep << "MB/s" << flush; 396 387 frac += 0.01; 397 388 } … … 399 390 400 391 const double elep = Time().UnixTime()-start.UnixTime(); 401 cout << setprecision(0) << "\r100% [" << set w(3) << 100.*com/tot << "%] cpu:" << setprecision(1)<< sec << "s out:" << tot/1000000/elep << "MB/s" << endl;392 cout << setprecision(0) << "\r100% [" << setprecision(1) << setw(5) << 100.*com/tot << "%] cpu:" << sec << "s out:" << tot/1000000/elep << "MB/s" << endl; 402 393 403 394 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.