DGtal 1.3.0
|
Aim: Represents an elementary functor that partitions quantities into regular intervals, given a range [min,max] range and a number nb of intervals (each interval is called a bin). More...
#include <DGtal/math/Histogram.h>
Public Types | |
typedef TQuantity | Quantity |
typedef RegularBinner< Quantity > | Self |
typedef DGtal::uint32_t | Bin |
Public Member Functions | |
RegularBinner (const Quantity &min, const Quantity &max, Bin n) | |
Bin | size () const |
Bin | operator() (const Quantity &q) const |
Data Fields | |
Quantity | myMin |
Quantity | myMax |
Bin | myNb |
Quantity | myWidth |
Aim: Represents an elementary functor that partitions quantities into regular intervals, given a range [min,max] range and a number nb of intervals (each interval is called a bin).
Description of template class 'RegularBinner'
Model of CBinner.
TQuantity | any number type, model of CEuclideanRing. |
Definition at line 64 of file Histogram.h.
typedef DGtal::uint32_t DGtal::RegularBinner< TQuantity >::Bin |
Definition at line 67 of file Histogram.h.
typedef TQuantity DGtal::RegularBinner< TQuantity >::Quantity |
Definition at line 65 of file Histogram.h.
typedef RegularBinner< Quantity > DGtal::RegularBinner< TQuantity >::Self |
Definition at line 66 of file Histogram.h.
|
inline |
Creates a regular binner that place quantities in range [min,max] in n bins (numbered from 0 to n-1), such that all bins have equal width \(\frac{max-min}{n}\).
min | any quantity smaller than min falls into bin 0. |
max | any quantity greater than max falls into bin n-1. |
n | the number of bins. |
Definition at line 84 of file Histogram.h.
References max(), and DGtal::RegularBinner< TQuantity >::myWidth.
|
inline |
Places the quantity q into the correct bin.
q | any quantity |
size()-1
]. Definition at line 105 of file Histogram.h.
References DGtal::RegularBinner< TQuantity >::myMax, DGtal::RegularBinner< TQuantity >::myMin, DGtal::RegularBinner< TQuantity >::myNb, and DGtal::RegularBinner< TQuantity >::myWidth.
|
inline |
Definition at line 95 of file Histogram.h.
References DGtal::RegularBinner< TQuantity >::myNb.
Quantity DGtal::RegularBinner< TQuantity >::myMax |
any value above is considered the same.
Definition at line 70 of file Histogram.h.
Referenced by DGtal::RegularBinner< TQuantity >::operator()().
Quantity DGtal::RegularBinner< TQuantity >::myMin |
any value below is considered the same.
Definition at line 69 of file Histogram.h.
Referenced by DGtal::RegularBinner< TQuantity >::operator()().
Bin DGtal::RegularBinner< TQuantity >::myNb |
the number of bins.
Definition at line 71 of file Histogram.h.
Referenced by DGtal::RegularBinner< TQuantity >::operator()(), and DGtal::RegularBinner< TQuantity >::size().
Quantity DGtal::RegularBinner< TQuantity >::myWidth |
the width of each bin.
Definition at line 72 of file Histogram.h.
Referenced by DGtal::RegularBinner< TQuantity >::operator()(), and DGtal::RegularBinner< TQuantity >::RegularBinner().