Functions
test_most_frequent.cxx File Reference
#include "WireCellUtil/Waveform.h"
#include <iostream>

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

int main ( void  )

Definition at line 7 of file test_most_frequent.cxx.

8 {
9  {
10  std::vector<short> adcv{-1,0,0,1,1,2,3,4,4,4,5,6,4,3,4,5,6,7,7,6,5};
11  auto mf = Waveform::most_frequent(adcv);
12  cerr << mf << endl;
13  }
14  {
15  std::vector<short> adcv{-1,0,0,-1,-1,2,3,4,4,-1,-1,5,6,4,3,4,5,6,7,7,6,5};
16  auto mf = Waveform::most_frequent(adcv);
17  cerr << mf << endl;
18  }
19  {
20  std::vector<short> adcv{5,5,5,5,1,1,1,2,2,2,2};
21  auto mf = Waveform::most_frequent(adcv);
22  cerr << mf << endl;
23  }
24 }
short most_frequent(const std::vector< short > &vals)
Return the smallest, most frequent value to appear in vector.
Definition: Waveform.cxx:289
QTextStream & endl(QTextStream &s)