fmcs  v0.2.1
Categorical Struct Reference

#include "distributions.hpp"

Inheritance diagram for Categorical:
Distribution< Categorical, unsigned long >

Public Member Functions

 Categorical (int dim)
 
template<typename... Vs>
 Categorical (std::variant< Vs... > probs)
 
 Categorical (std::vector< double > probs)
 
double at (size_t ix)
 Get the probability at the ix-th index.
 
unsigned long get_dim ()
 
std::vector< double > get_probs ()
 
double logprob (unsigned long value) const
 
template<typename RNG >
unsigned long sample (RNG &rng)
 
std::string string () const
 
- Public Member Functions inherited from Distribution< Categorical, unsigned long >
double logprob (unsigned long value)
 
unsigned long sample (RNG &rng)
 
std::string string () const
 

Public Attributes

std::discrete_distribution< int > dist
 
std::vector< double > probs
 

Detailed Description

A dynamic categorical distribution parameterized by a std::vector<double> of probabilities


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