00001
00002
00003
00004
00005
00006
00007 #ifndef HISTOGRAMS_BIN_H
00008 #define HISTOGRAMS_BIN_H
00009
00010 #include <iostream>
00011 #include "util/sparse-vector.h"
00012 #include "util/tree-node.h"
00013
00014 namespace libpmk {
00016
00020 class Bin : public TreeNode {
00021 public:
00022 Bin();
00023 Bin(const LargeIndex& index);
00024 virtual ~Bin() { }
00025
00027 double SetSize(double size);
00028
00030 double GetSize() const;
00031
00033 double IncrementCount();
00034
00036 double DecrementCount();
00037
00039 double SetCount(double count);
00040
00042 double GetCount() const;
00043
00044 virtual void ReadData(istream& input_stream);
00045 virtual void WriteData(ostream& output_stream) const;
00046
00048
00052 virtual void Combine(const TreeNode& other);
00053
00054 private:
00055 double size_;
00056 double count_;
00057 };
00058 }
00059 #endif // HISTOGRAMS_BIN_H