T
- Type of data in histogramD
- Type of input datapublic class FlexiHistogram<T,D> extends AggregatingHistogram<T,D>
Modifier and Type | Class and Description |
---|---|
static class |
FlexiHistogram.Adapter<T,D>
Adapter interface to specify bin creation, data caching and combination.
|
ReplacingHistogram.Iter, ReplacingHistogram.RIter
Modifier and Type | Field and Description |
---|---|
private int |
destsize
Destination (minimum) size of the structure.
|
private FlexiHistogram.Adapter<T,D> |
downsampler
Adapter class, extended "maker".
|
private ArrayList<Pair<Double,D>> |
tempcache
Cache for elements when not yet initialized.
|
Constructor and Description |
---|
FlexiHistogram(int bins,
FlexiHistogram.Adapter<T,D> adapter)
Create a new histogram for an unknown data range.
|
Modifier and Type | Method and Description |
---|---|
void |
aggregate(double coord,
D value)
Add a value to the histogram using the aggregation adapter.
|
static FlexiHistogram<Pair<Double,Double>,Pair<Double,Double>> |
DoubleSumDoubleSumHistogram(int bins)
Histograms that work like two
DoubleSumHistogram(int) , component wise. |
static FlexiHistogram<Double,Double> |
DoubleSumHistogram(int bins)
Convenience constructor for Double-based Histograms.
|
T |
get(double coord)
Get the data at a given Coordinate.
|
double |
getBinsize()
Get the size (width) of a bin.
|
double |
getCoverMaximum()
Get maximum (covered by bins, not data!)
|
double |
getCoverMinimum()
Get minimum (covered by bins, not data!)
|
ArrayList<T> |
getData()
Get the raw data.
|
int |
getNumBins()
Get the number of bins actually in use.
|
static FlexiHistogram<Integer,Integer> |
IntSumHistogram(int bins)
Convenience constructor for Integer-based Histograms.
|
static FlexiHistogram<Pair<Integer,Integer>,Pair<Integer,Integer>> |
IntSumIntSumHistogram(int bins)
Histograms that work like two
IntSumHistogram(int) , component wise. |
Iterator<Pair<Double,T>> |
iterator()
Get an iterator over all histogram bins.
|
static FlexiHistogram<Long,Long> |
LongSumHistogram(int bins)
Convenience constructor for Long-based Histograms.
|
static FlexiHistogram<Pair<Long,Long>,Pair<Long,Long>> |
LongSumLongSumHistogram(int bins)
Histograms that work like two
LongSumHistogram(int) , component wise. |
private void |
materialize() |
static FlexiHistogram<MeanVariance,Double> |
MeanVarianceHistogram(int bins)
Convenience constructor for
MeanVariance -based Histograms. |
void |
replace(double coord,
T d)
Put data at a given coordinate.
|
Iterator<Pair<Double,T>> |
reverseIterator()
Get an iterator over all histogram bins.
|
private void |
testResample() |
DoubleSumDoubleSumHistogram, DoubleSumHistogram, IntSumHistogram, IntSumIntSumHistogram, LongSumHistogram, LongSumLongSumHistogram, MeanVarianceHistogram
DoubleDoubleHistogram, DoubleHistogram, getBinNr, IntHistogram, IntIntHistogram, make
private FlexiHistogram.Adapter<T,D> downsampler
private int destsize
public FlexiHistogram(int bins, FlexiHistogram.Adapter<T,D> adapter)
bins
and
2*bins
bins in length.bins
- Target number of binsadapter
- Adapter for data types and combination rules.private void materialize()
public void replace(double coord, T d)
ReplacingHistogram
replace
in class ReplacingHistogram<T>
coord
- Coordinated
- New Dataprivate void testResample()
public T get(double coord)
ReplacingHistogram
get
in class ReplacingHistogram<T>
coord
- Coordinate.public double getBinsize()
ReplacingHistogram
getBinsize
in class ReplacingHistogram<T>
public double getCoverMaximum()
ReplacingHistogram
getCoverMaximum
in class ReplacingHistogram<T>
public double getCoverMinimum()
ReplacingHistogram
getCoverMinimum
in class ReplacingHistogram<T>
public ArrayList<T> getData()
ReplacingHistogram
getData
in class ReplacingHistogram<T>
public int getNumBins()
ReplacingHistogram
getNumBins
in class ReplacingHistogram<T>
public Iterator<Pair<Double,T>> iterator()
ReplacingHistogram
public Iterator<Pair<Double,T>> reverseIterator()
ReplacingHistogram
reverseIterator
in class ReplacingHistogram<T>
public void aggregate(double coord, D value)
AggregatingHistogram
aggregate
in class AggregatingHistogram<T,D>
coord
- Coordinatevalue
- New valuepublic static FlexiHistogram<Integer,Integer> IntSumHistogram(int bins)
bins
- Number of binspublic static FlexiHistogram<Long,Long> LongSumHistogram(int bins)
bins
- Number of binspublic static FlexiHistogram<Double,Double> DoubleSumHistogram(int bins)
bins
- Number of binspublic static FlexiHistogram<MeanVariance,Double> MeanVarianceHistogram(int bins)
MeanVariance
-based Histograms. Uses a
constructor to initialize bins with new MeanVariance
objectsbins
- Number of binsMeanVariance
.public static FlexiHistogram<Pair<Integer,Integer>,Pair<Integer,Integer>> IntSumIntSumHistogram(int bins)
IntSumHistogram(int)
, component wise.bins
- Number of bins.public static FlexiHistogram<Pair<Long,Long>,Pair<Long,Long>> LongSumLongSumHistogram(int bins)
LongSumHistogram(int)
, component wise.bins
- Number of bins.public static FlexiHistogram<Pair<Double,Double>,Pair<Double,Double>> DoubleSumDoubleSumHistogram(int bins)
DoubleSumHistogram(int)
, component wise.bins
- Number of bins.