lppl  v2.0.0
Categorical Struct Reference

#include "distributions.hpp"

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 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: