about 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.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/histogram.h b/histogram.h new file mode 100644 index 0000000..5aa2560 --- /dev/null +++ b/histogram.h
@@ -0,0 +1,19 @@
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
14 private:
15 std::map<T, int> freqtable;
16 std::map<int, T> distribution;
17};
18
19#endif /* end of include guard: HISTOGRAM_H_24094D97 */