UFO
ufo::TruncatingEquispacedBinSelector Class Reference

Represents a finite set of consecutive intervals (bins) of the same width, each closed from the left and open from the right. More...

#include <TruncatingEquispacedBinSelector.h>

Inheritance diagram for ufo::TruncatingEquispacedBinSelector:
Collaboration diagram for ufo::TruncatingEquispacedBinSelector:

Public Types

typedef float ValueType
 
typedef int IndexType
 
- Public Types inherited from ufo::EquispacedBinSelectorBase
typedef float ValueType
 
typedef int IndexType
 

Public Member Functions

 TruncatingEquispacedBinSelector (ValueType lowerBound, ValueType upperBound, IndexType numBins)
 Partition the interval [lowerBound, upperBound) into numBins bins of the same width. 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 lowerBound_
 
ValueType binWidth_
 
ValueType inverseBinWidth_
 
IndexType numBins_
 

Detailed Description

Represents a finite set of consecutive intervals (bins) of the same width, each closed from the left and open from the right.

Call the bin() function to find the bin containing a particular value.

Definition at line 23 of file TruncatingEquispacedBinSelector.h.

Member Typedef Documentation

◆ IndexType

◆ ValueType

Constructor & Destructor Documentation

◆ TruncatingEquispacedBinSelector()

ufo::TruncatingEquispacedBinSelector::TruncatingEquispacedBinSelector ( ValueType  lowerBound,
ValueType  upperBound,
IndexType  numBins 
)
inline

Partition the interval [lowerBound, upperBound) into numBins bins of the same width.

Definition at line 31 of file TruncatingEquispacedBinSelector.h.

Here is the call graph for this function:

Member Function Documentation

◆ bin()

IndexType ufo::TruncatingEquispacedBinSelector::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 TruncatingEquispacedBinSelector.h.

Here is the caller graph for this function:

◆ binCenter()

ValueType ufo::TruncatingEquispacedBinSelector::binCenter ( IndexType  bin) const
inlineoverridevirtual

Return the value lying at the center of the bin with index bin.

Implements ufo::EquispacedBinSelectorBase.

Definition at line 60 of file TruncatingEquispacedBinSelector.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binWidth()

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

Return the width of each bin.

Implements ufo::EquispacedBinSelectorBase.

Definition at line 52 of file TruncatingEquispacedBinSelector.h.

Here is the caller graph for this function:

◆ inverseBinWidth()

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

Return the inverse of the width of each bin.

Implements ufo::EquispacedBinSelectorBase.

Definition at line 56 of file TruncatingEquispacedBinSelector.h.

Here is the caller graph for this function:

◆ numBins()

boost::optional<IndexType> ufo::TruncatingEquispacedBinSelector::numBins ( ) const
inlineoverridevirtual

Return the number of bins or boost::none if the bin collection is infinite.

Implements ufo::EquispacedBinSelectorBase.

Definition at line 48 of file TruncatingEquispacedBinSelector.h.

Here is the caller graph for this function:

Member Data Documentation

◆ binWidth_

ValueType ufo::TruncatingEquispacedBinSelector::binWidth_
private

Definition at line 66 of file TruncatingEquispacedBinSelector.h.

◆ inverseBinWidth_

ValueType ufo::TruncatingEquispacedBinSelector::inverseBinWidth_
private

Definition at line 67 of file TruncatingEquispacedBinSelector.h.

◆ lowerBound_

ValueType ufo::TruncatingEquispacedBinSelector::lowerBound_
private

Definition at line 65 of file TruncatingEquispacedBinSelector.h.

◆ numBins_

IndexType ufo::TruncatingEquispacedBinSelector::numBins_
private

Definition at line 68 of file TruncatingEquispacedBinSelector.h.


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