public class NumericHistogram
extends Object
Modifier and Type | Class and Description |
---|---|
static class |
NumericHistogram.Coord
The Coord class defines a histogram bin, which is just an (x,y) pair.
|
Constructor and Description |
---|
NumericHistogram()
Creates a new histogram object.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double v)
Adds a new data point to the histogram approximation.
|
void |
addBin(double x,
double y,
int b)
Set a particular histogram bin with index.
|
void |
allocate(int num_bins)
Sets the number of histogram bins to use for approximating data.
|
NumericHistogram.Coord |
getBin(int b)
Returns a particular histogram bin.
|
int |
getNumBins()
Returns the number of bins.
|
int |
getUsedBins()
Returns the number of bins currently being used by the histogram.
|
boolean |
isReady()
Returns true if this histogram object has been initialized by calling merge()
or allocate().
|
void |
merge(NumericHistogram other)
Takes a histogram and merges it with the current histogram object.
|
void |
reset()
Resets a histogram object to its initial state.
|
void |
setUsedBins(int nusedBins)
Set the number of bins currently being used by the histogram.
|
public NumericHistogram()
public void reset()
public int getNumBins()
public int getUsedBins()
public void setUsedBins(int nusedBins)
public boolean isReady()
public NumericHistogram.Coord getBin(int b)
public void addBin(double x, double y, int b)
public void allocate(int num_bins)
num_bins
- Number of non-uniform-width histogram bins to usepublic void merge(NumericHistogram other)
public void add(double v)
v
- The data point to add to the histogram approximation.