Histogram
public class HistogramDiscrete extends java.lang.Object implements Histogram
Modifier and Type | Field | Description |
---|---|---|
protected long[] |
counts |
|
protected double[] |
histogram |
|
protected double |
tolerance |
|
protected long |
totalCount |
|
protected double[] |
xValues |
Constructor | Description |
---|---|
HistogramDiscrete(double tolerance) |
Modifier and Type | Method | Description |
---|---|---|
void |
addValue(double x) |
Adds the given value to the Histogram
|
long |
getCount() |
Returns the number of times the Histogram's addValue method was called.
|
double[] |
getHistogram() |
Returns the histogram as an array of doubles
|
int |
getNBins() |
Returns the number of bins in the histogram.
|
DoubleRange |
getXRange() |
Returns the range of x values (min and max) used in the histogram.
|
void |
reset() |
resets all histogram values and counts to zero
|
void |
setNBins(int n) |
Sets the number of bins used by the Histogram.
|
void |
setXRange(DoubleRange range) |
Sets the range of x values used in the histogram (min and max).
|
double[] |
xValues() |
Returns the x values from the histogram as an array of doubles
|
protected long totalCount
protected double tolerance
protected double[] xValues
protected long[] counts
protected double[] histogram
public void addValue(double x)
Histogram
public long getCount()
Histogram
public double[] getHistogram()
Histogram
getHistogram
in interface Histogram
public int getNBins()
Histogram
public DoubleRange getXRange()
Histogram
public void reset()
Histogram
public void setNBins(int n)
Histogram
public void setXRange(DoubleRange range)
Histogram