UFO
ufo::EquispacedBinSelectorBase Class Referenceabstract

A finite or infinite collection of non-overlapping intervals (bins) of the same width. More...

#include <EquispacedBinSelectorBase.h>

Inheritance diagram for ufo::EquispacedBinSelectorBase:

Public Types

typedef float ValueType
 
typedef int IndexType
 

Public Member Functions

virtual ~EquispacedBinSelectorBase ()
 
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. More...
 
virtual boost::optional< IndexTypenumBins () const =0
 Return the number of bins or boost::none if the bin collection is infinite. More...
 
virtual ValueType binWidth () const =0
 Return the width of each bin. More...
 
virtual ValueType inverseBinWidth () const =0
 Return the inverse of the width of each bin. More...
 
virtual ValueType binCenter (IndexType bin) const =0
 Return the value lying at the center of the bin with index bin. More...
 

Detailed Description

A finite or infinite collection of non-overlapping intervals (bins) of the same width.

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

Definition at line 19 of file EquispacedBinSelectorBase.h.

Member Typedef Documentation

◆ IndexType

◆ ValueType

Constructor & Destructor Documentation

◆ ~EquispacedBinSelectorBase()

virtual ufo::EquispacedBinSelectorBase::~EquispacedBinSelectorBase ( )
inlinevirtual

Definition at line 25 of file EquispacedBinSelectorBase.h.

Member Function Documentation

◆ bin()

virtual IndexType ufo::EquispacedBinSelectorBase::bin ( ValueType  value) const
pure virtual

Return the index of the bin containing value, or the nearest bin if value lies outside all bins.

Implemented in ufo::TruncatingEquispacedBinSelector, and ufo::RoundingEquispacedBinSelector.

◆ binCenter()

virtual ValueType ufo::EquispacedBinSelectorBase::binCenter ( IndexType  bin) const
pure virtual

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

Implemented in ufo::TruncatingEquispacedBinSelector, and ufo::RoundingEquispacedBinSelector.

◆ binWidth()

virtual ValueType ufo::EquispacedBinSelectorBase::binWidth ( ) const
pure virtual

Return the width of each bin.

Implemented in ufo::TruncatingEquispacedBinSelector, and ufo::RoundingEquispacedBinSelector.

◆ inverseBinWidth()

virtual ValueType ufo::EquispacedBinSelectorBase::inverseBinWidth ( ) const
pure virtual

Return the inverse of the width of each bin.

Implemented in ufo::TruncatingEquispacedBinSelector, and ufo::RoundingEquispacedBinSelector.

◆ numBins()

virtual boost::optional<IndexType> ufo::EquispacedBinSelectorBase::numBins ( ) const
pure virtual

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

Implemented in ufo::TruncatingEquispacedBinSelector, and ufo::RoundingEquispacedBinSelector.


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