![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
A class for sampling w.r.t. More...
#include <agrum/base/core/math/Dirichlet.h>
Public Types | |
| using | param_type = std::vector< float > |
| The parameter type. | |
| using | result_type = std::vector< float > |
| The type for the samples generated. | |
Public Member Functions | |
Constructors / Destructors | |
| Dirichlet (const param_type ¶ms) | |
| Default constructor. | |
| Dirichlet (const Dirichlet &from) | |
| Copy constructor. | |
| Dirichlet (Dirichlet &&from) | |
| Move constructor. | |
| ~Dirichlet () | |
| Class destructor. | |
Operators | |
| Dirichlet & | operator= (const Dirichlet &from) |
| Copy operator. | |
| Dirichlet & | operator= (Dirichlet &&from) |
| Move operator. | |
| result_type | operator() () |
| Returns a sample from the Dirichlet distribution. | |
| result_type | operator() (const param_type &p) |
| Returns a sample from the Dirichlet distribution. | |
Accessors / Modifiers | |
| const param_type & | param () const noexcept |
| Returns the parameters of the distribution. | |
| void | param (const param_type &p) |
| Sets the parameters of the distribution. | |
| float | min () const noexcept |
| Returns the greatest lower bound of the range of values returned by gum::Dirichlet::operator()(). | |
| float | max () const noexcept |
| Returns the lowest higher bound of the range of values returned by gum::Dirichlet::operator()(). | |
Private Attributes | |
| std::gamma_distribution< float > | _gamma_ |
| The gamma distribution used to compute the Dirichlet unnormalized samples. | |
| param_type | _params_ |
| The parameters of the distribution. | |
| using gum::Dirichlet::param_type = std::vector< float > |
The parameter type.
Definition at line 72 of file Dirichlet.h.
| using gum::Dirichlet::result_type = std::vector< float > |
The type for the samples generated.
Definition at line 75 of file Dirichlet.h.
| INLINE gum::Dirichlet::Dirichlet | ( | const param_type & | params | ) |
Default constructor.
| params | The distribution parameters. |
| seed | The distribution seed. |
Definition at line 51 of file Dirichlet_inl.h.
References Dirichlet(), and _params_.
Referenced by Dirichlet(), Dirichlet(), Dirichlet(), ~Dirichlet(), operator=(), and operator=().
| INLINE gum::Dirichlet::Dirichlet | ( | const Dirichlet & | from | ) |
Copy constructor.
| from | The distribution to copy. |
Definition at line 56 of file Dirichlet_inl.h.
References Dirichlet(), _gamma_, and _params_.
| INLINE gum::Dirichlet::Dirichlet | ( | Dirichlet && | from | ) |
Move constructor.
| from | The distribution to move. |
Definition at line 62 of file Dirichlet_inl.h.
References Dirichlet(), _gamma_, and _params_.
| INLINE gum::Dirichlet::~Dirichlet | ( | ) |
Class destructor.
Definition at line 68 of file Dirichlet_inl.h.
References Dirichlet().
|
noexcept |
Returns the lowest higher bound of the range of values returned by gum::Dirichlet::operator()().
Definition at line 137 of file Dirichlet_inl.h.
|
noexcept |
Returns the greatest lower bound of the range of values returned by gum::Dirichlet::operator()().
Definition at line 134 of file Dirichlet_inl.h.
| INLINE Dirichlet::result_type gum::Dirichlet::operator() | ( | ) |
Returns a sample from the Dirichlet distribution.
Definition at line 92 of file Dirichlet_inl.h.
References _gamma_, _params_, and gum::randomGenerator().
| INLINE Dirichlet::result_type gum::Dirichlet::operator() | ( | const param_type & | p | ) |
Returns a sample from the Dirichlet distribution.
| p | An object representing the distribution's parameters, obtained by a call to gum::Dirichlet::param(const param_type&). |
Definition at line 110 of file Dirichlet_inl.h.
References _gamma_, and gum::randomGenerator().
Copy operator.
| from | The distribution to copy. |
Definition at line 74 of file Dirichlet_inl.h.
References Dirichlet(), _gamma_, and _params_.
Move operator.
| from | The distribution to move. |
Definition at line 83 of file Dirichlet_inl.h.
References Dirichlet(), _gamma_, and _params_.
|
noexcept |
Returns the parameters of the distribution.
Definition at line 128 of file Dirichlet_inl.h.
References _params_.
| INLINE void gum::Dirichlet::param | ( | const param_type & | p | ) |
Sets the parameters of the distribution.
| p | An object representing the distribution's parameters, obtained by a call to member function param. |
Definition at line 131 of file Dirichlet_inl.h.
References _params_.
|
private |
The gamma distribution used to compute the Dirichlet unnormalized samples.
Definition at line 179 of file Dirichlet.h.
Referenced by Dirichlet(), Dirichlet(), operator()(), operator()(), operator=(), and operator=().
|
private |
The parameters of the distribution.
Definition at line 182 of file Dirichlet.h.
Referenced by Dirichlet(), Dirichlet(), Dirichlet(), operator()(), operator=(), operator=(), param(), and param().