public static class Histogram.ConstantBinScheme extends java.lang.Object implements Histogram.BinScheme
Constructor and Description |
---|
ConstantBinScheme(int bins,
double min,
double max)
Create a bin scheme with the specified number of bins that all have the same width.
|
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 ConstantBinScheme(int bins, double min, double max)
bins
- the number of bins; must be at least 2min
- the minimum value to be counted in the binsmax
- 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