#include <hpp/statistics/distribution.hh>
Public Types | |
typedef std::size_t | 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. More... | |
Weight_t | get (const Value_t &v) const |
Get the weight of a value Return 0 if value was not found. More... | |
size_t | size () const |
Return the number of value. More... | |
std::vector< Proba_t > | probabilities () const |
Return the probabilities. More... | |
std::vector< Value_t > | values () const |
Return the values. More... | |
Weight_t | totalWeight () const |
Return the total weight. More... | |
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 std::size_t hpp::statistics::DiscreteDistribution< Value_t >::Weight_t |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the weight of a value Return 0 if value was not found.
|
inline |
Update the distribution.
If v is already in the set, then update its weight. Otherwise, insert it.
|
inline |
|
inline |
|
inline |
|
inline |
Return the probabilities.
|
inline |
Return the number of value.
|
inline |
Return the total weight.
|
inline |
Return the values.