UFO
ufo::RoundingEquispacedBinSelector Class Reference

Represents an infinite set of consecutive intervals (bins) of the same width. More...

#include <RoundingEquispacedBinSelector.h>

Inheritance diagram for ufo::RoundingEquispacedBinSelector:
Collaboration diagram for ufo::RoundingEquispacedBinSelector:

Public Types

typedef float ValueType
 
typedef int IndexType
 
- Public Types inherited from ufo::EquispacedBinSelectorBase
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< IndexTypenumBins () 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...
 
- Public Member Functions inherited from ufo::EquispacedBinSelectorBase
virtual ~EquispacedBinSelectorBase ()
 

Private Attributes

ValueType binWidth_
 
ValueType inverseBinWidth_
 
ValueType bin0Center_
 

Detailed Description

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.

Member Typedef Documentation

◆ IndexType

◆ ValueType

Constructor & Destructor Documentation

◆ RoundingEquispacedBinSelector()

ufo::RoundingEquispacedBinSelector::RoundingEquispacedBinSelector ( ValueType  binWidth,
ValueType  bin0Center = 0 
)
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.

Here is the call graph for this function:

Member Function Documentation

◆ bin()

IndexType ufo::RoundingEquispacedBinSelector::bin ( ValueType  value) const
inlineoverridevirtual

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.

Here is the caller graph for this function:

◆ binCenter()

ValueType ufo::RoundingEquispacedBinSelector::binCenter ( IndexType  bin) const
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.

Here is the call graph for this function:

◆ binWidth()

ValueType ufo::RoundingEquispacedBinSelector::binWidth ( ) const
inlineoverridevirtual

Return the width of each bin.

Implements ufo::EquispacedBinSelectorBase.

Definition at line 50 of file RoundingEquispacedBinSelector.h.

Here is the caller graph for this function:

◆ inverseBinWidth()

ValueType ufo::RoundingEquispacedBinSelector::inverseBinWidth ( ) const
inlineoverridevirtual

Return the inverse of the width of each bin.

Implements ufo::EquispacedBinSelectorBase.

Definition at line 54 of file RoundingEquispacedBinSelector.h.

◆ numBins()

boost::optional<IndexType> ufo::RoundingEquispacedBinSelector::numBins ( ) const
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.

Member Data Documentation

◆ bin0Center_

ValueType ufo::RoundingEquispacedBinSelector::bin0Center_
private

Definition at line 65 of file RoundingEquispacedBinSelector.h.

◆ binWidth_

ValueType ufo::RoundingEquispacedBinSelector::binWidth_
private

Definition at line 63 of file RoundingEquispacedBinSelector.h.

◆ inverseBinWidth_

ValueType ufo::RoundingEquispacedBinSelector::inverseBinWidth_
private

Definition at line 64 of file RoundingEquispacedBinSelector.h.


The documentation for this class was generated from the following file: