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

hpp-statistics 9.0.2 Classes for doing statistics.

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
hpp::statistics::DiscreteDistribution< Value_t > Class Template Reference

`#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 ()=default
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)
Weight_t | get (const Value_t &v) const
size_t | size () const
| Return the number of value.
std::vector< Proba_t > | probabilities () 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

## Member Typedef Documentation

## ◆ const_iterator

template<typename Value_t >

typedef std::vector<ProbaTPair>::const_iterator hpp::statistics::DiscreteDistribution< Value_t >::const_iterator

## ◆ iterator

template<typename Value_t >

typedef std::vector<ProbaTPair>::iterator hpp::statistics::DiscreteDistribution< Value_t >::iterator

## ◆ ProbaTPair

template<typename Value_t >

typedef std::pair<Weight_t, Value_t> hpp::statistics::DiscreteDistribution< Value_t >::ProbaTPair

## ◆ Weight_t

template<typename Value_t >

typedef std::size_t hpp::statistics::DiscreteDistribution< Value_t >::Weight_t

## Constructor & Destructor Documentation

## ◆ DiscreteDistribution()

template<typename Value_t >

hpp::statistics::DiscreteDistribution< Value_t >::DiscreteDistribution | ( |  | ) |
| default

## Member Function Documentation

## ◆ begin() [1/2]

template<typename Value_t >

iterator hpp::statistics::DiscreteDistribution< Value_t >::begin | ( |  | ) |
| inline

## ◆ begin() [2/2]

template<typename Value_t >

const_iterator hpp::statistics::DiscreteDistribution< Value_t >::begin | ( |  | ) | const
| inline

## ◆ end() [1/2]

template<typename Value_t >

iterator hpp::statistics::DiscreteDistribution< Value_t >::end | ( |  | ) |
| inline

## ◆ end() [2/2]

template<typename Value_t >

const_iterator hpp::statistics::DiscreteDistribution< Value_t >::end | ( |  | ) | const
| inline

## ◆ get()

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.

## ◆ insert()

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.

## ◆ operator()() [1/3]

template<typename Value_t >

Value_t hpp::statistics::DiscreteDistribution< Value_t >::operator() | ( |  | ) | const
| inline

## ◆ operator()() [2/3]

template<typename Value_t >

Value_t hpp::statistics::DiscreteDistribution< Value_t >::operator() | ( | const Proba_t & | p | ) | const
| inline

## ◆ operator()() [3/3]

template<typename Value_t >

Value_t hpp::statistics::DiscreteDistribution< Value_t >::operator() | ( | const Weight_t & | w | ) | const
| inline

## ◆ probabilities()

template<typename Value_t >

std::vector< Proba_t > hpp::statistics::DiscreteDistribution< Value_t >::probabilities | ( |  | ) | const
| inline

Return the probabilities.

## ◆ size()

template<typename Value_t >

size_t hpp::statistics::DiscreteDistribution< Value_t >::size | ( |  | ) | const
| inline

Return the number of value.

## ◆ totalWeight()

template<typename Value_t >

Weight_t hpp::statistics::DiscreteDistribution< Value_t >::totalWeight | ( |  | ) | const
| inline

Return the total weight.

## ◆ values()

template<typename Value_t >

std::vector< Value_t > hpp::statistics::DiscreteDistribution< Value_t >::values | ( |  | ) | const
| inline

Return the values.

The documentation for this class was generated from the following file:

- include/hpp/statistics/distribution.hh