Representation of a histogram. More...
#include <OpenMS/MATH/STATISTICS/Histogram.h>
Public Types | |
| typedef std::vector< ValueType > ::const_iterator | ConstIterator |
| Non-mutable iterator of the bins. | |
Public Member Functions | |
| BinSizeType | minBound () const |
| returns the lower bound | |
| BinSizeType | maxBound () const |
| returns the upper bound | |
| ValueType | maxValue () const |
| returns the highest value of all bins | |
| ValueType | minValue () const |
| returns the lowest value of all bins | |
| BinSizeType | binSize () const |
| returns the bin size | |
| Size | size () const |
| returns the number of bins | |
| ValueType | operator[] (Size index) const |
returns the value of bin index | |
| BinSizeType | centerOfBin (Size bin_index) const |
returns the center position of the bin with the index bin_index | |
| ValueType | binValue (BinSizeType val) const |
returns the value of bin corresponding to the value val | |
| Size | inc (BinSizeType val, ValueType increment=1) |
increases the bin corresponding to value val by increment | |
| void | reset (BinSizeType min, BinSizeType max, BinSizeType bin_size) |
| resets the histogram with the given range and bin size | |
| void | applyLogTransformation (BinSizeType multiplier) |
| Transforms the bin values with f(x)=multiplier*log(x+1). | |
Constructors and Destructors | |
| Histogram () | |
| default constructor | |
| Histogram (const Histogram &histogram) | |
| copy constructor | |
| Histogram (BinSizeType min, BinSizeType max, BinSizeType bin_size) | |
| constructor with min, max and bin size | |
| virtual | ~Histogram () |
| destructor | |
Assignment and equality operators | |
| bool | operator== (const Histogram &histogram) const |
| Equality operator. | |
| bool | operator!= (const Histogram &histogram) const |
| Inequality operator. | |
| Histogram & | operator= (const Histogram &histogram) |
| Assignment. | |
Iterators | |
| ConstIterator | begin () const |
| Non-mutable iterator pointing to the first bin. | |
| ConstIterator | end () const |
| Non-mutable iterator pointing after the last bin. | |
Protected Member Functions | |
| Size | valToBin_ (BinSizeType val) const |
| Returns the bin a given value belongs to. | |
Protected Attributes | |
| BinSizeType | min_ |
| Lower bound. | |
| BinSizeType | max_ |
| Upper bound. | |
| BinSizeType | bin_size_ |
| Bin size. | |
| std::vector< ValueType > | bins_ |
| Vector of bins. | |
Representation of a histogram.
The first template argument gives the Type of the values that are stored in the bins. The second argument gives the type for the bin size and range.
| typedef std::vector<ValueType>::const_iterator ConstIterator |
Non-mutable iterator of the bins.
| Histogram | ( | ) | [inline] |
default constructor
| Histogram | ( | BinSizeType | min, | |
| BinSizeType | max, | |||
| BinSizeType | bin_size | |||
| ) | [inline] |
constructor with min, max and bin size
| Exception::OutOfRange | is thrown if bin_size negative or zero |
References Histogram< ValueType, BinSizeType >::bin_size_, Histogram< ValueType, BinSizeType >::bins_, Histogram< ValueType, BinSizeType >::max_, and Histogram< ValueType, BinSizeType >::min_.
| virtual ~Histogram | ( | ) | [inline, virtual] |
destructor
| void applyLogTransformation | ( | BinSizeType | multiplier | ) | [inline] |
Transforms the bin values with f(x)=multiplier*log(x+1).
References Histogram< ValueType, BinSizeType >::bins_.
| ConstIterator begin | ( | ) | const [inline] |
Non-mutable iterator pointing to the first bin.
References Histogram< ValueType, BinSizeType >::bins_.
| BinSizeType binSize | ( | ) | const [inline] |
returns the bin size
References Histogram< ValueType, BinSizeType >::bin_size_.
| ValueType binValue | ( | BinSizeType | val | ) | const [inline] |
returns the value of bin corresponding to the value val
| Exception::OutOfRange | is thrown if the value is out of valid range |
References Histogram< ValueType, BinSizeType >::bins_, and Histogram< ValueType, BinSizeType >::valToBin_().
| BinSizeType centerOfBin | ( | Size | bin_index | ) | const [inline] |
returns the center position of the bin with the index bin_index
| Exception::IndexOverflow | is thrown for invalid indices |
References Histogram< ValueType, BinSizeType >::bin_size_, Histogram< ValueType, BinSizeType >::bins_, and Histogram< ValueType, BinSizeType >::min_.
| ConstIterator end | ( | ) | const [inline] |
Non-mutable iterator pointing after the last bin.
References Histogram< ValueType, BinSizeType >::bins_.
| Size inc | ( | BinSizeType | val, | |
| ValueType | increment = 1 | |||
| ) | [inline] |
increases the bin corresponding to value val by increment
| Exception::OutOfRange | is thrown if the value is out of valid range |
References Histogram< ValueType, BinSizeType >::bins_, and Histogram< ValueType, BinSizeType >::valToBin_().
| BinSizeType maxBound | ( | ) | const [inline] |
returns the upper bound
References Histogram< ValueType, BinSizeType >::max_.
| ValueType maxValue | ( | ) | const [inline] |
returns the highest value of all bins
References Histogram< ValueType, BinSizeType >::bins_.
| BinSizeType minBound | ( | ) | const [inline] |
returns the lower bound
References Histogram< ValueType, BinSizeType >::min_.
| ValueType minValue | ( | ) | const [inline] |
returns the lowest value of all bins
References Histogram< ValueType, BinSizeType >::bins_.
| bool operator!= | ( | const Histogram< ValueType, BinSizeType > & | histogram | ) | const [inline] |
Inequality operator.
References Histogram< ValueType, BinSizeType >::operator==().
| bool operator== | ( | const Histogram< ValueType, BinSizeType > & | histogram | ) | const [inline] |
Equality operator.
References Histogram< ValueType, BinSizeType >::bin_size_, Histogram< ValueType, BinSizeType >::bins_, Histogram< ValueType, BinSizeType >::max_, and Histogram< ValueType, BinSizeType >::min_.
Referenced by Histogram< ValueType, BinSizeType >::operator!=().
| ValueType operator[] | ( | Size | index | ) | const [inline] |
returns the value of bin index
| Exception::IndexOverflow | is thrown for invalid indices |
References Histogram< ValueType, BinSizeType >::bins_.
| void reset | ( | BinSizeType | min, | |
| BinSizeType | max, | |||
| BinSizeType | bin_size | |||
| ) | [inline] |
resets the histogram with the given range and bin size
| Exception::OutOfRange | is thrown if bin_size negative or zero |
References Histogram< ValueType, BinSizeType >::bin_size_, Histogram< ValueType, BinSizeType >::bins_, Histogram< ValueType, BinSizeType >::max_, and Histogram< ValueType, BinSizeType >::min_.
| Size size | ( | ) | const [inline] |
returns the number of bins
References Histogram< ValueType, BinSizeType >::bins_.
| Size valToBin_ | ( | BinSizeType | val | ) | const [inline, protected] |
Returns the bin a given value belongs to.
| Exception::OutOfRange | is thrown if the value is out of valid range |
References Histogram< ValueType, BinSizeType >::bins_, Histogram< ValueType, BinSizeType >::max_, and Histogram< ValueType, BinSizeType >::min_.
Referenced by Histogram< ValueType, BinSizeType >::binValue(), and Histogram< ValueType, BinSizeType >::inc().
BinSizeType bin_size_ [protected] |
Bin size.
Referenced by Histogram< ValueType, BinSizeType >::binSize(), Histogram< ValueType, BinSizeType >::centerOfBin(), Histogram< ValueType, BinSizeType >::Histogram(), Histogram< ValueType, BinSizeType >::operator=(), Histogram< ValueType, BinSizeType >::operator==(), and Histogram< ValueType, BinSizeType >::reset().
std::vector<ValueType> bins_ [protected] |
Vector of bins.
Referenced by Histogram< ValueType, BinSizeType >::applyLogTransformation(), Histogram< ValueType, BinSizeType >::begin(), Histogram< ValueType, BinSizeType >::binValue(), Histogram< ValueType, BinSizeType >::centerOfBin(), Histogram< ValueType, BinSizeType >::end(), Histogram< ValueType, BinSizeType >::Histogram(), Histogram< ValueType, BinSizeType >::inc(), Histogram< ValueType, BinSizeType >::maxValue(), Histogram< ValueType, BinSizeType >::minValue(), Histogram< ValueType, BinSizeType >::operator=(), Histogram< ValueType, BinSizeType >::operator==(), Histogram< ValueType, BinSizeType >::operator[](), Histogram< ValueType, BinSizeType >::reset(), Histogram< ValueType, BinSizeType >::size(), and Histogram< ValueType, BinSizeType >::valToBin_().
BinSizeType max_ [protected] |
Upper bound.
Referenced by Histogram< ValueType, BinSizeType >::Histogram(), Histogram< ValueType, BinSizeType >::maxBound(), Histogram< ValueType, BinSizeType >::operator=(), Histogram< ValueType, BinSizeType >::operator==(), Histogram< ValueType, BinSizeType >::reset(), and Histogram< ValueType, BinSizeType >::valToBin_().
BinSizeType min_ [protected] |
Lower bound.
Referenced by Histogram< ValueType, BinSizeType >::centerOfBin(), Histogram< ValueType, BinSizeType >::Histogram(), Histogram< ValueType, BinSizeType >::minBound(), Histogram< ValueType, BinSizeType >::operator=(), Histogram< ValueType, BinSizeType >::operator==(), Histogram< ValueType, BinSizeType >::reset(), and Histogram< ValueType, BinSizeType >::valToBin_().
| OpenMS / TOPP release 1.10.0 | Documentation generated on Thu Mar 7 2013 09:43:00 using doxygen 1.7.1 |