public abstract class AbstractStaticHistogram extends java.lang.Object implements Histogram
Modifier and Type | Class and Description |
---|---|
class |
AbstractStaticHistogram.Iter
Iterator class to iterate over all bins.
|
Modifier and Type | Field and Description |
---|---|
protected double |
base
Array 'base', i.e. the point of 0.0.
|
protected double |
binsize
Width of a bin.
|
protected double |
max
To avoid introducing an extra bucket for the maximum value.
|
protected int |
offset
Array shift to account for negative indices.
|
protected int |
size
Size of array storage.
|
CACHE_SHIFT
Constructor and Description |
---|
AbstractStaticHistogram(int bins,
double min,
double max)
Histogram constructor
|
Modifier and Type | Method and Description |
---|---|
protected int |
getBinNr(double coord)
Compute the bin number.
|
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.
|
protected static int |
growSize(int current,
int requiredSize)
Compute the size to grow to.
|
abstract AbstractStaticHistogram.Iter |
iter()
Get an iterator over all histogram bins.
|
protected int offset
protected int size
protected double base
protected double max
protected double binsize
public AbstractStaticHistogram(int bins, double min, double max)
bins
- Number of bins to use.min
- Minimum Valuemax
- Maximum Valueprotected int getBinNr(double coord)
coord
- Coordinateprotected static int growSize(int current, int requiredSize)
current
- Current sizerequiredSize
- Required sizepublic int getNumBins()
getNumBins
in interface Histogram
public double getBinsize()
getBinsize
in interface Histogram
public double getCoverMinimum()
getCoverMinimum
in interface Histogram
public double getCoverMaximum()
getCoverMaximum
in interface Histogram
public abstract AbstractStaticHistogram.Iter iter()
Copyright © 2019 ELKI Development Team. License information.