quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_stat.a #include <Histogram.h> ~Histogram(); Histogram(); Histogram(const Histogram& copy_sym); boolean read(Sof& sof, long tag, const String& name = CLASS_NAME); boolean setMode(BIN_MODE mode); boolean setBins(const TVector& bins); boolean setBins(T1 min = DEF_MIN, T2 max = DEF_MAX, long num_bins = DEF_NUM_BINS); boolean setCounts(const TVector& counts);
description:#include <Histogram.h> // test a histogram with a specified number of bins in CENTERS mode for // all data types // expected_counts.assign(L"2, 1, 1, 1, 1, 1, 1, 1, 1, 1"); hist6.clear(); hist6.setMode(CENTERS); hist6.compute(byte_data, DEF_NUM_BINS); hist6.getCounts(actual_counts); if (!actual_counts.eq(expected_counts)) { actual_counts.debug(L"actual counts"); expected_counts.debug(L"expected counts"); return Error::handle(name(), L"compute", Error::TEST, __FILE__, __LINE__); }
static const String CLASS_NAME = L"Histogram";
static const String Histogram::DEF_PARAM = L"";
static const String Histogram::PARAM_MODE = L"mode";
static const String Histogram::PARAM_BINS = L"bins";
static const String Histogram::PARAM_COUNTS = L"counts";
static const NameMap MODE_MAP(L"CENTERS, EDGES");
static const long DEF_MIN = 0;
static const long DEF_MAX = 1;
static const long DEF_NUM_BINS = 10;
enum BIN_MODE { CENTERS = 0, EDGES, DEF_MODE = CENTERS};
static const long ERR = 60500;
static const long ERR_BINS = 60501;
BIN_MODE mode_d;
VectorDouble bins_d;
VectorDouble counts_d;
static Integral::DEBUG debug_level_d;
static MemoryManager mgr_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
static boolean setDebug(Integral::DEBUG debug_level);
boolean debug(const unichar* message) const;
~Histogram();
Histogram(BIN_MODE mode = DEF_MODE);
Histogram(const Histogram& arg);
boolean assign(const Histogram& arg);
Histogram& operator= (const Histogram& arg);
long sofSize() const;
boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);
boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;
boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false);
boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;
boolean eq(const Histogram& compare_hist) const;
static void* operator new(size_t size);
static void* operator new[](size_t size);
static void operator delete(void* ptr);
static void operator delete[](void* ptr);
static boolean setGrowSize(long grow_size);
boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);
boolean setMode(BIN_MODE mode);
template<class TVector> boolean setBins(const TVector& bins);
template<class T1, class T2> boolean setBins(T1 min = DEF_MIN, T2 max = DEF_MAX, long num_bins = DEF_NUM_BINS);
template<class TVector> boolean setCounts(const TVector& counts);
BIN_MODE getMode();
boolean getBins(VectorDouble& bins);
template<class TVector> boolean getCounts(TVector& counts);
template<class TVector> boolean compute(const TVector& values);
template<class TVector> boolean compute(const TVector& values, long num_bins);
template<class TVector> boolean compute(const TVector& values, const TVector& bins);
template<class TVector> boolean update(const TVector& values);
boolean pdf(VectorDouble& pdf) const;
boolean cdf(VectorDouble& cdf) const;
boolean prettyPrint() const;