public static class Histogram.LinearBinScheme extends java.lang.Object implements Histogram.BinScheme
Constructor and Description |
---|
LinearBinScheme(int numBins,
double max)
Create a linear bin scheme with the specified number of bins and the maximum value to be counted in the bins.
|
Modifier and Type | Method and Description |
---|---|
int |
bins()
Get the number of bins.
|
double |
fromBin(int b)
Determine the value at the upper range of the specified bin.
|
int |
toBin(double x)
Determine the 0-based bin number in which the supplied value should be placed.
|
public LinearBinScheme(int numBins, double max)
numBins
- the number of bins; must be at least 2max
- the maximum value to be counted in the binspublic int bins()
Histogram.BinScheme
bins
in interface Histogram.BinScheme
public double fromBin(int b)
Histogram.BinScheme
fromBin
in interface Histogram.BinScheme
b
- the 0-based bin numbernegative infinity
if the bin number is negative or positive infinity
if the 0-based
bin number is greater than or equal to the number of bins
.public int toBin(double x)
Histogram.BinScheme
toBin
in interface Histogram.BinScheme
x
- the value