|
fmcs
v0.2.1
|
A discrete distribution over an arbitrary collection of items parameterized by a std::vector<double> of probabilities. More...
#include "distributions.hpp"
Public Member Functions | |
| template<typename... Vs> | |
| Discrete (std::variant< Vs... > probs, std::variant< Vs... > items) | |
| Discrete (std::vector< double > probs, std::vector< T > items_) | |
| double | at (size_t ix) |
| Get the probability at the ix-th index. | |
| unsigned long | findix (T value) const |
| /// More... | |
| unsigned long | get_dim () |
| std::vector< double > | get_probs () |
| double | logprob (T value) const |
| template<typename RNG > | |
| T | sample (RNG &rng) |
| std::string | string () const |
Public Member Functions inherited from Distribution< Discrete< T >, T > | |
| double | logprob (T value) |
| T | sample (RNG &rng) |
| std::string | string () const |
Public Attributes | |
| Categorical | dist |
| std::map< unsigned long, T > | items |
A discrete distribution over an arbitrary collection of items parameterized by a std::vector<double> of probabilities.
The items must overload operator<< for string stream output and be equality comparable
| T | the type of the item over which the discrete distribution is parameterized |