8 #ifndef UFO_UTILS_EQUISPACEDBINSELECTORBASE_H_
9 #define UFO_UTILS_EQUISPACEDBINSELECTORBASE_H_
11 #include <boost/optional.hpp>
32 virtual boost::optional<IndexType>
numBins()
const = 0;
A finite or infinite collection of non-overlapping intervals (bins) of the same width.
virtual ValueType binCenter(IndexType bin) const =0
Return the value lying at the center of the bin with index bin.
virtual ValueType inverseBinWidth() const =0
Return the inverse of the width of each bin.
virtual IndexType bin(ValueType value) const =0
Return the index of the bin containing value, or the nearest bin if value lies outside all bins.
virtual ValueType binWidth() const =0
Return the width of each bin.
virtual ~EquispacedBinSelectorBase()
virtual boost::optional< IndexType > numBins() const =0
Return the number of bins or boost::none if the bin collection is infinite.