Class DoubleHistogram
- java.lang.Object
-
- elki.utilities.datastructures.histogram.AbstractStaticHistogram
-
- elki.utilities.datastructures.histogram.DoubleHistogram
-
- All Implemented Interfaces:
Histogram
- Direct Known Subclasses:
DoubleDynamicHistogram
public class DoubleHistogram extends AbstractStaticHistogram
Histogram class storing double values.The histogram will start with "bin" bins, but it can grow dynamically to the left and right.
- Since:
- 0.5.5
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DoubleHistogram.Iter
Iterator class.
-
Field Summary
Fields Modifier and Type Field Description (package private) double[]
data
Data store-
Fields inherited from class elki.utilities.datastructures.histogram.AbstractStaticHistogram
base, binsize, max, offset, size
-
Fields inherited from interface elki.utilities.datastructures.histogram.Histogram
CACHE_SHIFT
-
-
Constructor Summary
Constructors Constructor Description DoubleHistogram(int bins, double min, double max)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
get(double coord)
Get the value at a particular position.void
increment(double coord, double val)
Increment the value of a bin.DoubleHistogram.Iter
iter()
Get an iterator over all histogram bins.-
Methods inherited from class elki.utilities.datastructures.histogram.AbstractStaticHistogram
getBinNr, getBinsize, getCoverMaximum, getCoverMinimum, getNumBins, growSize
-
-
-
-
Method Detail
-
increment
public void increment(double coord, double val)
Increment the value of a bin.- Parameters:
coord
- Coordinateval
- Value
-
get
public double get(double coord)
Get the value at a particular position.- Parameters:
coord
- Coordinate- Returns:
- Value
-
iter
public DoubleHistogram.Iter iter()
Description copied from class:AbstractStaticHistogram
Get an iterator over all histogram bins.- Specified by:
iter
in interfaceHistogram
- Specified by:
iter
in classAbstractStaticHistogram
- Returns:
- Iterator
-
-