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