Legend:
Library
Module
Module type
Parameter
Class
Class type
Histograms with polymorphic bin types.
A histogram is a list of bins, each with a count. Bin i is defined by a lower limit lo(i) and an upper limit hi(i). It is inclusive of the lower limit and exclusive of the upper limit. For all i, hi(i) = lo(i+1). By convention the first bin is numbered 0. The count of a bin is a floating point number, allowing fractional values if necessary.
type'a t
The type of a histogram whose bin limits are of type 'a.
make cmp bins returns a new histogram from the given bins, all initialized to a count of 0.0. The bins must be provided as a list of the boundaries dividing them. The list [v0; v1; ...; vn] of length n+1 represents the n bins [v0, v1), [v1, v2), ..., [vn-1, vn), where cmp is used as the comparison function. Returns None if bins are not monotonically increasing, or if length of bins is less than 2.
increment delt hist x increments the count of the bin containing x by delt (default is 1.0). The histogram is unaltered if x not in any bin. This is not considered an error because it is often necessary to calculate a histogram for a subset of a larger data set.
make_uniform min max n returns a histogram with n bins uniformly dividing up the range from min to max. Bins will be inclusive of the lower limit and exclusive of the upper limit, i.e. value of min will fall into lowest bin and value of max will fall outside the range of the histogram. Raise Failure if min not strictly less than max or if n not greater than 0.