hpp::statistics::DiscreteDistribution< Value_t > Class Template Reference

#include <hpp/statistics/distribution.hh>

List of all members.

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.
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_tprobabilities () const
 Return the probabilities.
std::vector< Value_t > values () const
 Return the values.
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

template<typename Value_t>
class hpp::statistics::DiscreteDistribution< Value_t >


Member Typedef Documentation

template<typename Value_t >
typedef std::vector< ProbaTPair >::const_iterator hpp::statistics::DiscreteDistribution< Value_t >::const_iterator
template<typename Value_t >
typedef std::vector< ProbaTPair >::iterator hpp::statistics::DiscreteDistribution< Value_t >::iterator
template<typename Value_t >
typedef std::pair< Weight_t, Value_t> hpp::statistics::DiscreteDistribution< Value_t >::ProbaTPair
template<typename Value_t >
typedef std::size_t hpp::statistics::DiscreteDistribution< Value_t >::Weight_t

Constructor & Destructor Documentation

template<typename Value_t >
hpp::statistics::DiscreteDistribution< Value_t >::DiscreteDistribution ( ) [inline]

Member Function Documentation

template<typename Value_t >
iterator hpp::statistics::DiscreteDistribution< Value_t >::begin ( ) [inline]
template<typename Value_t >
const_iterator hpp::statistics::DiscreteDistribution< Value_t >::begin ( ) const [inline]
template<typename Value_t >
iterator hpp::statistics::DiscreteDistribution< Value_t >::end ( ) [inline]
template<typename Value_t >
const_iterator hpp::statistics::DiscreteDistribution< Value_t >::end ( ) const [inline]
template<typename Value_t >
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.

template<typename Value_t >
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.

template<typename Value_t >
Value_t hpp::statistics::DiscreteDistribution< Value_t >::operator() ( ) const [inline]
template<typename Value_t >
Value_t hpp::statistics::DiscreteDistribution< Value_t >::operator() ( const Proba_t p) const [inline]
template<typename Value_t >
Value_t hpp::statistics::DiscreteDistribution< Value_t >::operator() ( const Weight_t w) const [inline]
template<typename Value_t >
std::vector< Proba_t > hpp::statistics::DiscreteDistribution< Value_t >::probabilities ( ) const [inline]

Return the probabilities.

template<typename Value_t >
size_t hpp::statistics::DiscreteDistribution< Value_t >::size ( ) const [inline]

Return the number of value.

template<typename Value_t >
Weight_t hpp::statistics::DiscreteDistribution< Value_t >::totalWeight ( ) const [inline]

Return the total weight.

template<typename Value_t >
std::vector< Value_t > hpp::statistics::DiscreteDistribution< Value_t >::values ( ) const [inline]

Return the values.