UFO
|
Represents an infinite set of consecutive intervals (bins) of the same width. More...
#include <RoundingEquispacedBinSelector.h>
Public Types | |
typedef float | ValueType |
typedef int | IndexType |
![]() | |
typedef float | ValueType |
typedef int | IndexType |
Public Member Functions | |
RoundingEquispacedBinSelector (ValueType binWidth, ValueType bin0Center=0) | |
Partition the real axis into bins of width binWidth , with the center of bin 0 located at bin0Center . More... | |
IndexType | bin (ValueType value) const override |
Return the index of the bin containing value , or the nearest bin if value lies outside all bins. More... | |
boost::optional< IndexType > | numBins () const override |
Return the number of bins or boost::none if the bin collection is infinite. More... | |
ValueType | binWidth () const override |
Return the width of each bin. More... | |
ValueType | inverseBinWidth () const override |
Return the inverse of the width of each bin. More... | |
ValueType | binCenter (IndexType bin) const override |
Return the value lying at the center of the bin with index bin . More... | |
![]() | |
virtual | ~EquispacedBinSelectorBase () |
Private Attributes | |
ValueType | binWidth_ |
ValueType | inverseBinWidth_ |
ValueType | bin0Center_ |
Represents an infinite set of consecutive intervals (bins) of the same width.
Bin 0 is open; bins 1, 2 etc. are right-open; bins -1, -2 etc. are left-open.
Call the bin() function to find the bin containing a particular value.
Definition at line 25 of file RoundingEquispacedBinSelector.h.
typedef int ufo::RoundingEquispacedBinSelector::IndexType |
Definition at line 29 of file RoundingEquispacedBinSelector.h.
typedef float ufo::RoundingEquispacedBinSelector::ValueType |
Definition at line 28 of file RoundingEquispacedBinSelector.h.
|
inlineexplicit |
Partition the real axis into bins of width binWidth
, with the center of bin 0 located at bin0Center
.
Definition at line 33 of file RoundingEquispacedBinSelector.h.
Return the index of the bin containing value
, or the nearest bin if value
lies outside all bins.
Implements ufo::EquispacedBinSelectorBase.
Definition at line 41 of file RoundingEquispacedBinSelector.h.
|
inlineoverridevirtual |
Return the value lying at the center of the bin with index bin
.
Implements ufo::EquispacedBinSelectorBase.
Definition at line 58 of file RoundingEquispacedBinSelector.h.
|
inlineoverridevirtual |
Return the width of each bin.
Implements ufo::EquispacedBinSelectorBase.
Definition at line 50 of file RoundingEquispacedBinSelector.h.
|
inlineoverridevirtual |
Return the inverse of the width of each bin.
Implements ufo::EquispacedBinSelectorBase.
Definition at line 54 of file RoundingEquispacedBinSelector.h.
|
inlineoverridevirtual |
Return the number of bins or boost::none if the bin collection is infinite.
Implements ufo::EquispacedBinSelectorBase.
Definition at line 46 of file RoundingEquispacedBinSelector.h.
|
private |
Definition at line 65 of file RoundingEquispacedBinSelector.h.
|
private |
Definition at line 63 of file RoundingEquispacedBinSelector.h.
|
private |
Definition at line 64 of file RoundingEquispacedBinSelector.h.