#include <OpenMS/MATH/STATISTICS/Histogram.h>
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.
Public Types | |
typedef std::vector< ValueType > ::const_iterator | ConstIterator |
Non-mutable iterator of the bins. | |
Public Member Functions | |
BinSizeType | min () const |
returns to the lower bound | |
BinSizeType | max () 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 | |
UInt | size () const |
returns the number of bins | |
ValueType | operator[] (UInt index) const throw (Exception::IndexOverflow) |
returns the value of bin index | |
BinSizeType | centerOfBin (UInt bin_index) const throw (Exception::IndexOverflow) |
returns the center position of the bin with the index bin_index | |
ValueType | binValue (BinSizeType val) const throw (Exception::OutOfRange) |
returns the value of bin corresponding to the value val | |
void | inc (BinSizeType val, ValueType increment=1) throw (Exception::OutOfRange) |
increases the bin corresponding to value val by increment | |
void | reset (BinSizeType min, BinSizeType max, BinSizeType bin_size) throw (Exception::OutOfRange) |
resets the histogram with the given range and bin size | |
void | applyLogTransformation (Real 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) throw (Exception::OutOfRange) | |
constructor with min, max and bin size | |
~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 | |
UInt | valToBin_ (BinSizeType val) const throw (Exception::OutOfRange) |
Protected Attributes | |
BinSizeType | min_ |
Lower bound. | |
BinSizeType | max_ |
Upper bound. | |
BinSizeType | bin_size_ |
Bin size. | |
std::vector< ValueType > | bins_ |
Vector of bins. |
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 | |||
) | throw (Exception::OutOfRange) [inline] |
constructor with min, max and bin size
~Histogram | ( | ) | [inline] |
destructor
BinSizeType min | ( | ) | const [inline] |
returns to the lower bound
BinSizeType max | ( | ) | const [inline] |
returns the upper bound
ValueType maxValue | ( | ) | const [inline] |
returns the highest value of all bins
ValueType minValue | ( | ) | const [inline] |
returns the lowest value of all bins
BinSizeType binSize | ( | ) | const [inline] |
returns the bin size
UInt size | ( | ) | const [inline] |
returns the number of bins
ValueType operator[] | ( | UInt | index | ) | const throw (Exception::IndexOverflow) [inline] |
returns the value of bin index
BinSizeType centerOfBin | ( | UInt | bin_index | ) | const throw (Exception::IndexOverflow) [inline] |
returns the center position of the bin with the index bin_index
ValueType binValue | ( | BinSizeType | val | ) | const throw (Exception::OutOfRange) [inline] |
returns the value of bin corresponding to the value val
void inc | ( | BinSizeType | val, | |
ValueType | increment = 1 | |||
) | throw (Exception::OutOfRange) [inline] |
increases the bin corresponding to value val
by increment
void reset | ( | BinSizeType | min, | |
BinSizeType | max, | |||
BinSizeType | bin_size | |||
) | throw (Exception::OutOfRange) [inline] |
resets the histogram with the given range and bin size
bool operator== | ( | const Histogram< ValueType, BinSizeType > & | histogram | ) | const [inline] |
Equality operator.
bool operator!= | ( | const Histogram< ValueType, BinSizeType > & | histogram | ) | const [inline] |
Inequality operator.
ConstIterator begin | ( | ) | const [inline] |
Non-mutable iterator pointing to the first bin.
ConstIterator end | ( | ) | const [inline] |
Non-mutable iterator pointing after the last bin.
void applyLogTransformation | ( | Real | multiplier | ) | [inline] |
Transforms the bin values with f(x)=multiplier*log(x+1).
UInt valToBin_ | ( | BinSizeType | val | ) | const throw (Exception::OutOfRange) [inline, protected] |
BinSizeType min_ [protected] |
Lower bound.
BinSizeType max_ [protected] |
Upper bound.
BinSizeType bin_size_ [protected] |
Bin size.
std::vector<ValueType> bins_ [protected] |
Vector of bins.
Generated Tue Apr 1 15:36:50 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |