This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/CLPBN/clpbn/bp/Histogram.h
Vitor Santos Costa 21d317b223 new version of bp
2012-03-22 11:33:24 +00:00

45 lines
831 B
C++

#ifndef HORUS_HISTOGRAM_H
#define HORUS_HISTOGRAM_H
#include <vector>
#include <ostream>
using namespace std;
typedef vector<unsigned> Histogram;
class HistogramSet
{
public:
HistogramSet (unsigned, unsigned);
void nextHistogram (void);
unsigned operator[] (unsigned idx) const;
unsigned nrHistograms (void) const;
void reset (void);
static vector<Histogram> getHistograms (unsigned ,unsigned);
static unsigned nrHistograms (unsigned, unsigned);
static unsigned findIndex (
const Histogram&,
const vector<Histogram>&);
friend std::ostream& operator<< (ostream &os, const HistogramSet& hs);
private:
unsigned maxCount (unsigned) const;
void clearAfter (unsigned);
unsigned size_;
Histogram hist_;
};
#endif // HORUS_HISTOGRAM_H