Histogram, java.io.SerializableHistogramCollapsing, HistogramExpandingpublic class HistogramSimple extends java.lang.Object implements Histogram, java.io.Serializable
| Modifier and Type | Field | Description |
|---|---|---|
protected long[] |
counts |
|
protected double |
deltaX |
|
protected double[] |
histogram |
|
protected int |
nBins |
|
protected long |
sum |
|
protected double |
xMax |
|
protected double |
xMin |
|
protected double[] |
xValues |
| Constructor | Description |
|---|---|
HistogramSimple(int n,
DoubleRange xRange) |
Makes a new histogram instance, with the range of x values given by
xRange and n bins.
|
HistogramSimple(DoubleRange xRange) |
Makes a new histogram instance, with the range of x values given by
xRange.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addValue(double x) |
Adds the given value to the Histogram
|
long[] |
getBinCounts() |
|
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 xRange) |
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 double deltaX
protected long sum
protected long[] counts
protected double[] histogram
protected double[] xValues
protected double xMin
protected double xMax
protected int nBins
public HistogramSimple(DoubleRange xRange)
public HistogramSimple(int n,
DoubleRange xRange)
public void reset()
Histogrampublic void addValue(double x)
Histogrampublic void setXRange(DoubleRange xRange)
Histogrampublic DoubleRange getXRange()
Histogrampublic int getNBins()
Histogrampublic void setNBins(int n)
Histogrampublic double[] getHistogram()
HistogramgetHistogram in interface Histogrampublic long getCount()
Histogrampublic double[] xValues()
Histogrampublic long[] getBinCounts()