T - the value typepublic class Histogram<T extends Number & Comparable> extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_BIN
Constant indicating that a value does not fall in any bin
|
| Constructor and Description |
|---|
Histogram()
Creates a new histogram.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBin(Range<T> range)
Adds a new bin to the histogram.
|
int |
addValue(T value)
Adds a value to the histogram.
|
void |
addValues(List<T> values)
Adds a list of values to the histogram.
|
int |
getBinForValue(T value)
Gets the bin index for a value.
|
List<Integer> |
getBinForValues(List<T> values)
Gets bin indices for a list of input values.
|
List<Integer> |
getCounts()
Gets the count of data items in each bin.
|
int |
size()
Gets the number of bins.
|
public static final int NO_BIN
public void addBin(Range<T> range) throws org.jaitools.numeric.HistogramException
range - the data range for this bin.HistogramException - if the new bin overlaps with an existing binpublic int addValue(T value)
value - the valueNO_BINpublic void addValues(List<T> values)
values - input valuespublic int getBinForValue(T value)
value - the valueNO_BINpublic List<Integer> getBinForValues(List<T> values)
values - input valuesList of bin indicespublic int size()
Copyright © 2009–2018. All rights reserved.