Constructor and Description |
---|
BinMapper() |
Modifier and Type | Method and Description |
---|---|
static BinMapper |
createMapper(boolean log,
double binWidth,
double binPhase,
double point)
Returns a BinMapper instance.
|
abstract int |
getBinIndex(double value)
Returns the bin index for a given value.
|
abstract double[] |
getBinLimits(int index)
Returns the bin limits for a given bin index.
|
static double |
log(double val)
Logarithm function, used for transforming values on logarithmic X axis.
|
public abstract int getBinIndex(double value)
value
- valid axis valuepublic abstract double[] getBinLimits(int index)
index
- bin indexpublic static BinMapper createMapper(boolean log, double binWidth, double binPhase, double point)
Notional bin boundaries are for 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 static double log(double val)
val
- valueval
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.