name: Histogram

synopsis:
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);

quick start:
#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__);
}
 
description:

Histogram: a class for storing, computing, and updating histograms of data. the Histogram class works under two binning modes:

  1. Histogram(Vector Y): bins the elements of Y into DEF_NUM_BINS equally spaced containers on the range of min(Y), max(Y)

  2. Histogram(Vector Y, long M): bins the elements of Y into M bins

  3. Histogram(Vector Y, Vector X): bins the elements of Y into bins according to the bin boundaries specified in X. These boundaries are interpreted depending on the binning mode.
dependencies:

public constants:

error codes:

protected data:

required public methods:

class-specific public methods:

private methods:

examples:

notes: