UFO
ufo::EquispacedBinSelector Class Reference

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

#include <EquispacedBinSelector.h>

Public Types

typedef float ValueType
 
typedef int IndexType
 

Public Member Functions

 EquispacedBinSelector (ValueType lowerBound, ValueType upperBound, IndexType numBins)
 Partition the interval [lowerBound, upperBound] into numBins bins of the same width. More...
 
IndexType bin (ValueType value) const
 Return the (0-based) index of the bin containing value, or the nearest bin if value lies outside all bins. More...
 
IndexType numBins () const
 Return the number of bins. More...
 
ValueType binWidth () const
 Return the width of each bin. More...
 
ValueType inverseBinWidth () const
 Return the inverse of the width of each bin. More...
 
ValueType binCenter (IndexType bin) const
 Return the value lying at the center of the bin with index bin. More...
 

Private Attributes

ValueType lowerBound_
 
ValueType binWidth_
 
ValueType inverseBinWidth_
 
IndexType numBins_
 

Detailed Description

Represents a set of consecutive intervals (bins) of the same width.

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

Definition at line 21 of file EquispacedBinSelector.h.

Member Typedef Documentation

◆ IndexType

Definition at line 26 of file EquispacedBinSelector.h.

◆ ValueType

Definition at line 25 of file EquispacedBinSelector.h.

Constructor & Destructor Documentation

◆ EquispacedBinSelector()

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

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

Definition at line 30 of file EquispacedBinSelector.h.

Here is the call graph for this function:

Member Function Documentation

◆ bin()

IndexType ufo::EquispacedBinSelector::bin ( ValueType  value) const
inline

Return the (0-based) index of the bin containing value, or the nearest bin if value lies outside all bins.

Definition at line 42 of file EquispacedBinSelector.h.

Here is the caller graph for this function:

◆ binCenter()

ValueType ufo::EquispacedBinSelector::binCenter ( IndexType  bin) const
inline

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

Definition at line 65 of file EquispacedBinSelector.h.

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

◆ binWidth()

ValueType ufo::EquispacedBinSelector::binWidth ( ) const
inline

Return the width of each bin.

Definition at line 55 of file EquispacedBinSelector.h.

Here is the caller graph for this function:

◆ inverseBinWidth()

ValueType ufo::EquispacedBinSelector::inverseBinWidth ( ) const
inline

Return the inverse of the width of each bin.

Definition at line 60 of file EquispacedBinSelector.h.

Here is the caller graph for this function:

◆ numBins()

IndexType ufo::EquispacedBinSelector::numBins ( ) const
inline

Return the number of bins.

Definition at line 50 of file EquispacedBinSelector.h.

Here is the caller graph for this function:

Member Data Documentation

◆ binWidth_

ValueType ufo::EquispacedBinSelector::binWidth_
private

Definition at line 71 of file EquispacedBinSelector.h.

◆ inverseBinWidth_

ValueType ufo::EquispacedBinSelector::inverseBinWidth_
private

Definition at line 72 of file EquispacedBinSelector.h.

◆ lowerBound_

ValueType ufo::EquispacedBinSelector::lowerBound_
private

Definition at line 70 of file EquispacedBinSelector.h.

◆ numBins_

IndexType ufo::EquispacedBinSelector::numBins_
private

Definition at line 73 of file EquispacedBinSelector.h.


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