public class BinBag
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
BinBag.Bin
Describes the extent of a bin and the value it contains.
|
Constructor and Description |
---|
BinBag(boolean log,
double binWidth,
double binPhase,
double point)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addToBin(double point,
double inc)
Adds a value to the bin in which a given point falls.
|
java.util.Iterator<double[]> |
barIterator(double lo,
double hi)
Iterates over all the bins defined by this bin bag in a given
data interval.
|
java.util.Iterator<BinBag.Bin> |
binIterator(boolean cumulative,
Normalisation norm)
Returns a sorted iterator over all bins with non-zero values.
|
double |
getBinWidth()
Returns the bin width used by this histogram model.
|
boolean |
matches(boolean log,
double binWidth,
double binPhase)
Indicates whether the bin boundaries used by this object are the
same as a given bin set specification.
|
public BinBag(boolean log, double binWidth, double binPhase, double point)
log=false
:
binWidth*(0+binPhase), binWidth*(1+binPhase), ...and for
log=true
:
binWidth**(0+binPhase), binWidth**(1+binPhase), ...
The point
parameter is used internally to determine
the zero point of the bins. In principle this should make no
difference to behaviour, but in case that the data is situated
a very long way from 1, setting it close to
the actual data point locations may avoid rounding errors.
log
- false for linear axis scaling, true for logarithmicbinWidth
- width of each bin; this is additive for linear
and multiplicative for logarithmic scalingbinPhase
- determines sub-bin boundary shifts along axis,
normally in range 0..1point
- representative point on axis near which bins are
situatedpublic void addToBin(double point, double inc)
point
- axis coordinateinc
- value to accumulate onto bin valuepublic java.util.Iterator<BinBag.Bin> binIterator(boolean cumulative, Normalisation norm)
cumulative
- true for bins of a cumulative histogramnorm
- normalisation modepublic java.util.Iterator<double[]> barIterator(double lo, double hi)
lo
- lower bound of interesthi
- upper bound of interestpublic double getBinWidth()
public boolean matches(boolean log, double binWidth, double binPhase)
log
- false for linear scaling, true for logarithmicbinWidth
- width of each bin; this is additive for linear
and multiplicative for logarithmic scalingbinPhase
- determines sub-bin boundary shifts along axis
normally in range 0..1Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.