#include <hpp/statistics/distribution.hh>
Public Types | |
typedef unsigned int | Weight_t |
typedef std::pair< Weight_t, Value_t > | ProbaTPair |
typedef std::vector < ProbaTPair >::iterator | iterator |
typedef std::vector < ProbaTPair >::const_iterator | const_iterator |
Public Member Functions | |
DiscreteDistribution () | |
Value_t | operator() () const |
Value_t | operator() (const Proba_t &p) const |
Value_t | operator() (const Weight_t &w) const |
void | insert (Value_t v, Weight_t w=1) |
Update the distribution. | |
Weight_t | get (const Value_t &v) const |
Get the weight of a value Return 0 if value was not found. | |
size_t | size () const |
Return the number of value. | |
std::vector< Proba_t > | probabilities () const |
Return the probabilities. | |
Weight_t | totalWeight () const |
Return the total weight. | |
Iterators | |
Iterate on the values. | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
typedef std::vector< ProbaTPair >::const_iterator hpp::statistics::DiscreteDistribution< Value_t >::const_iterator |
typedef std::vector< ProbaTPair >::iterator hpp::statistics::DiscreteDistribution< Value_t >::iterator |
typedef std::pair< Weight_t, Value_t> hpp::statistics::DiscreteDistribution< Value_t >::ProbaTPair |
typedef unsigned int hpp::statistics::DiscreteDistribution< Value_t >::Weight_t |
hpp::statistics::DiscreteDistribution< Value_t >::DiscreteDistribution | ( | ) | [inline] |
iterator hpp::statistics::DiscreteDistribution< Value_t >::begin | ( | ) | [inline] |
const_iterator hpp::statistics::DiscreteDistribution< Value_t >::begin | ( | ) | const [inline] |
iterator hpp::statistics::DiscreteDistribution< Value_t >::end | ( | ) | [inline] |
const_iterator hpp::statistics::DiscreteDistribution< Value_t >::end | ( | ) | const [inline] |
Weight_t hpp::statistics::DiscreteDistribution< Value_t >::get | ( | const Value_t & | v | ) | const [inline] |
Get the weight of a value Return 0 if value was not found.
void hpp::statistics::DiscreteDistribution< Value_t >::insert | ( | Value_t | v, |
Weight_t | w = 1 |
||
) | [inline] |
Update the distribution.
If v is already in the set, then update its weight. Otherwise, insert it.
Value_t hpp::statistics::DiscreteDistribution< Value_t >::operator() | ( | ) | const [inline] |
Value_t hpp::statistics::DiscreteDistribution< Value_t >::operator() | ( | const Proba_t & | p | ) | const [inline] |
Value_t hpp::statistics::DiscreteDistribution< Value_t >::operator() | ( | const Weight_t & | w | ) | const [inline] |
std::vector< Proba_t > hpp::statistics::DiscreteDistribution< Value_t >::probabilities | ( | ) | const [inline] |
Return the probabilities.
size_t hpp::statistics::DiscreteDistribution< Value_t >::size | ( | ) | const [inline] |
Return the number of value.
Weight_t hpp::statistics::DiscreteDistribution< Value_t >::totalWeight | ( | ) | const [inline] |
Return the total weight.