31 return static_cast<double>(index) + f;
36 int index =
static_cast<int>(value);
42 }
else if (index >=
static_cast<int>(axis.
size())) {
46 Bin1D bin = axis.
bin(
static_cast<size_t>(index));
47 result = bin.
m_lower + (value -
static_cast<double>(index)) * bin.
binSize();
Defines structs Bin1D, Bin1DCVector.
Defines namespace DataUtils.
Defines and implements templated class Frame.
double m_upper
upper bound of the bin
double m_lower
lower bound of the bin
const IAxis & xAxis() const
const IAxis & yAxis() const
Abstract base class for one-dimensional axes.
virtual size_t findClosestIndex(double value) const =0
find bin index which is best match for given value
virtual Bin1D bin(size_t index) const =0
retrieve a 1d bin for the given index
virtual size_t size() const =0
Returns the number of bins.
void coordinatesToBinf(double &x, double &y, const Frame &frame)
Transforms x,y coordinate from Datafield axes coordinates to bin-fraction-coordinates.
void coordinatesFromBinf(double &x, double &y, const Frame &frame)
Transforms x,y coordinate from bin-fraction-coordinates to Datafield's axes coordinates.
double coordinateToBinf(double coordinate, const IAxis &axis)
Transforms coordinate on axis into the bin-fraction-coordinate.
double coordinateFromBinf(double value, const IAxis &axis)
Transforms bin-fraction-coordinate into axis coordinate.