summary refs log tree commit diff stats
path: root/histogram.h
blob: 76d8f1b6137bd244466817bb8738c4f5db28684b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef HISTOGRAM_H_24094D97
#define HISTOGRAM_H_24094D97

#include <map>
#include <string>

template <class T>
class histogram {
  public:
    void add(const T& inst);
    void compile();
    const T& next() const;
    void print() const;
    
  private:
    std::map<T, int> freqtable;
    std::map<int, T> distribution;
};

#endif /* end of include guard: HISTOGRAM_H_24094D97 */