Template class to do statistics. More...
#include <hpp/statistics/bin.hh>
Public Types | |
typedef std::list< T > | Container |
typedef Container::iterator | iterator |
typedef Container::const_iterator | const_iterator |
Public Member Functions | |
virtual std::size_t | freq (const T &bin) const |
Return the number of occurence of a Bin. | |
virtual Proba_t | relativeFreq (const T &bin) const |
Return the relative frequency of a Bin. | |
std::size_t | numberOfObservations () const |
Return the number of times an observation has recorded. | |
unsigned int | numberOfBins () const |
Return the number of bins. | |
virtual std::ostream & | print (std::ostream &os) const |
Put the results in a stream. | |
const_iterator | find (const T &bin) const |
template<typename U > | |
const_iterator | find (const U &value) const |
const_iterator | begin () const |
Return an iterator pointing at the beginning of the set of bins. | |
const_iterator | end () const |
Return an iterator pointing at the end of the set of bins. | |
void | clear () |
Remove all element. | |
Protected Member Functions | |
Statistics () | |
Constructor. | |
virtual T & | increment (const T &bin) __attribute__((deprecated)) |
Increment a Bin. | |
virtual iterator | insert (const T &bin) |
insert a Bin. |
Template class to do statistics.
You should derivate class Bin and construct a class Statistics < YourBin >.
typedef Container::const_iterator hpp::statistics::Statistics< T >::const_iterator |
typedef std::list< T > hpp::statistics::Statistics< T >::Container |
typedef Container::iterator hpp::statistics::Statistics< T >::iterator |
hpp::statistics::Statistics< T >::Statistics | ( | ) | [protected] |
Constructor.
const_iterator hpp::statistics::Statistics< T >::begin | ( | ) | const [inline] |
Return an iterator pointing at the beginning of the set of bins.
Referenced by hpp::statistics::Statistics< T >::increment(), and hpp::statistics::Statistics< T >::insert().
void hpp::statistics::Statistics< T >::clear | ( | ) | [inline] |
Remove all element.
const_iterator hpp::statistics::Statistics< T >::end | ( | ) | const [inline] |
Return an iterator pointing at the end of the set of bins.
Referenced by hpp::statistics::Statistics< T >::find().
Statistics< T >::const_iterator hpp::statistics::Statistics< T >::find | ( | const T & | bin | ) | const |
References hpp::statistics::Statistics< T >::end().
Statistics< T >::const_iterator hpp::statistics::Statistics< T >::find | ( | const U & | value | ) | const |
size_t hpp::statistics::Statistics< T >::freq | ( | const T & | bin | ) | const [virtual] |
Return the number of occurence of a Bin.
bin | a Bin for which only the value is useful. |
References hpp::statistics::Statistics< T >::freq().
Referenced by hpp::statistics::Statistics< T >::freq(), and hpp::statistics::Statistics< T >::relativeFreq().
T & hpp::statistics::Statistics< T >::increment | ( | const T & | bin | ) | [protected, virtual] |
Increment a Bin.
References hpp::statistics::Statistics< T >::begin().
Statistics< T >::iterator hpp::statistics::Statistics< T >::insert | ( | const T & | bin | ) | [protected, virtual] |
insert a Bin.
References hpp::statistics::Statistics< T >::begin().
unsigned int hpp::statistics::Statistics< T >::numberOfBins | ( | ) | const [inline] |
Return the number of bins.
std::size_t hpp::statistics::Statistics< T >::numberOfObservations | ( | ) | const [inline] |
Return the number of times an observation has recorded.
It is the total number of observations.
std::ostream & hpp::statistics::Statistics< T >::print | ( | std::ostream & | os | ) | const [virtual] |
Put the results in a stream.
Proba_t hpp::statistics::Statistics< T >::relativeFreq | ( | const T & | bin | ) | const [virtual] |
Return the relative frequency of a Bin.
bin | a Bin for which only the value is useful. |
References hpp::statistics::Statistics< T >::freq().