public class ShortDynamicHistogram extends ShortStaticHistogram
ShortStaticHistogram.Iter
Modifier and Type | Field and Description |
---|---|
private double[] |
cachec
Cache for data to be inserted.
|
private int |
cachefill
Cache fill size
|
private short[] |
cachev
Cache for data to be inserted.
|
private int |
destsize
Destination (minimum) size of the structure.
|
data
base, binsize, max, offset, size
CACHE_SHIFT
Constructor and Description |
---|
ShortDynamicHistogram(int bins)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected short |
downsample(short[] data,
int start,
int end,
int size)
Perform downsampling on a number of bins.
|
short |
get(double coord)
Get the value at a particular position.
|
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!)
|
int |
getNumBins()
Get the number of bins actually in use.
|
void |
increment(double coord,
short value)
Put fresh data into the histogram (or into the cache)
|
ShortStaticHistogram.Iter |
iter()
Get an iterator over all histogram bins.
|
(package private) void |
materialize()
Materialize the histogram from the cache.
|
private void |
testResample(double coord)
Test (and perform) downsampling when neede.
|
getBinNr, growSize
private double[] cachec
private short[] cachev
private int cachefill
private int destsize
public ShortDynamicHistogram(int bins)
bins
- Design number of bins - may become twice as large!void materialize()
public short get(double coord)
ShortStaticHistogram
get
in class ShortStaticHistogram
coord
- Coordinatepublic void increment(double coord, short value)
increment
in interface ShortHistogram
increment
in class ShortStaticHistogram
coord
- Coordinatevalue
- Valueprivate void testResample(double coord)
coord
- coordinate to accomodate.public ShortStaticHistogram.Iter iter()
AbstractStaticHistogram
iter
in interface Histogram
iter
in interface ShortHistogram
iter
in class ShortStaticHistogram
public int getNumBins()
AbstractStaticHistogram
getNumBins
in interface Histogram
getNumBins
in class AbstractStaticHistogram
public double getBinsize()
AbstractStaticHistogram
getBinsize
in interface Histogram
getBinsize
in class AbstractStaticHistogram
public double getCoverMinimum()
AbstractStaticHistogram
getCoverMinimum
in interface Histogram
getCoverMinimum
in class AbstractStaticHistogram
public double getCoverMaximum()
AbstractStaticHistogram
getCoverMaximum
in interface Histogram
getCoverMaximum
in class AbstractStaticHistogram
protected short downsample(short[] data, int start, int end, int size)
data
- Data array (needs cast!)start
- Interval startend
- Interval end (exclusive)size
- Intended size - extra bins are assumed to be empty, should be a
power of twoCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.