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/horus/Histogram.h
Tiago Gomes 206cf0a9c7 Trivial
2013-02-08 00:20:01 +00:00

53 lines
1.0 KiB
C++

#ifndef YAP_PACKAGES_CLPBN_HORUS_HISTOGRAM_H_
#define YAP_PACKAGES_CLPBN_HORUS_HISTOGRAM_H_
#include <vector>
#include <ostream>
#include "Horus.h"
typedef std::vector<unsigned> Histogram;
namespace horus {
class HistogramSet
{
public:
HistogramSet (unsigned, unsigned);
void nextHistogram (void);
unsigned operator[] (size_t idx) const;
unsigned nrHistograms (void) const;
void reset (void);
static std::vector<Histogram> getHistograms (unsigned, unsigned);
static unsigned nrHistograms (unsigned, unsigned);
static size_t findIndex (
const Histogram&, const std::vector<Histogram>&);
static std::vector<double> getNumAssigns (unsigned, unsigned);
private:
unsigned maxCount (size_t) const;
void clearAfter (size_t);
friend std::ostream& operator<< (std::ostream&, const HistogramSet&);
unsigned size_;
Histogram hist_;
DISALLOW_COPY_AND_ASSIGN (HistogramSet);
};
} // namespace horus
#endif // YAP_PACKAGES_CLPBN_HORUS_HISTOGRAM_H_