summary refs log tree commit diff stats
path: root/histogram.h
diff options
context:
space:
mode:
Diffstat (limited to 'histogram.h')
-rw-r--r--histogram.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/histogram.h b/histogram.h new file mode 100644 index 0000000..76d8f1b --- /dev/null +++ b/histogram.h
@@ -0,0 +1,20 @@
1#ifndef HISTOGRAM_H_24094D97
2#define HISTOGRAM_H_24094D97
3
4#include <map>
5#include <string>
6
7template <class T>
8class histogram {
9 public:
10 void add(const T& inst);
11 void compile();
12 const T& next() const;
13 void print() const;
14
15 private:
16 std::map<T, int> freqtable;
17 std::map<int, T> distribution;
18};
19
20#endif /* end of include guard: HISTOGRAM_H_24094D97 */