![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
A class for sampling w.r.t. More...
#include <agrum/tools/core/math/Dirichlet.h>
Public Member Functions | |
template<class URNG > | |
INLINE Dirichlet::result_type | operator() (URNG &generator, const Dirichlet::param_type &parm) |
Constructors / Destructors | |
Dirichlet (const param_type ¶ms, unsigned int seed=GUM_RANDOMSEED) | |
Default constructor. More... | |
Dirichlet (const Dirichlet &from) | |
Copy constructor. More... | |
Dirichlet (Dirichlet &&from) | |
Move constructor. More... | |
~Dirichlet () | |
Class destructor. More... | |
Operators | |
Dirichlet & | operator= (const Dirichlet &from) |
Copy operator. More... | |
Dirichlet & | operator= (Dirichlet &&from) |
Move operator. More... | |
result_type | operator() () |
Returns a sample from the Dirichlet distribution. More... | |
result_type | operator() (const param_type &p) |
Returns a sample from the Dirichlet distribution. More... | |
template<class URNG > | |
result_type | operator() (URNG &generator, const param_type &p) |
Returns a sample from the Dirichlet distribution. More... | |
Accessors / Modifiers | |
const param_type & | param () const noexcept |
Returns the parameters of the distribution. More... | |
void | param (const param_type &p) |
Sets the parameters of the distribution. More... | |
float | min () const noexcept |
Returns the greatest lower bound of the range of values returned by gum::Dirichlet::operator()(). More... | |
float | max () const noexcept |
Returns the lowest higher bound of the range of values returned by gum::Dirichlet::operator()(). More... | |
Public Types | |
using | param_type = std::vector< float > |
The parameter type. More... | |
using | result_type = std::vector< float > |
The type for the samples generated. More... | |
using gum::Dirichlet::param_type = std::vector< float > |
The parameter type.
Definition at line 52 of file Dirichlet.h.
using gum::Dirichlet::result_type = std::vector< float > |
The type for the samples generated.
Definition at line 55 of file Dirichlet.h.
INLINE gum::Dirichlet::Dirichlet | ( | const param_type & | params, |
unsigned int | seed = GUM_RANDOMSEED |
||
) |
Default constructor.
params | The distribution parameters. |
seed | The distribution seed. |
Definition at line 31 of file Dirichlet_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE gum::Dirichlet::Dirichlet | ( | const Dirichlet & | from | ) |
Copy constructor.
from | The distribution to copy. |
Definition at line 37 of file Dirichlet_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE gum::Dirichlet::Dirichlet | ( | Dirichlet && | from | ) |
Move constructor.
from | The distribution to move. |
Definition at line 43 of file Dirichlet_inl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE gum::Dirichlet::~Dirichlet | ( | ) |
Class destructor.
Definition at line 50 of file Dirichlet_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
Returns the lowest higher bound of the range of values returned by gum::Dirichlet::operator()().
Definition at line 121 of file Dirichlet_inl.h.
|
noexcept |
Returns the greatest lower bound of the range of values returned by gum::Dirichlet::operator()().
Definition at line 118 of file Dirichlet_inl.h.
INLINE Dirichlet::result_type gum::Dirichlet::operator() | ( | URNG & | generator, |
const Dirichlet::param_type & | parm | ||
) |
Definition at line 33 of file Dirichlet_tpl.h.
References gum::Set< Key, Alloc >::emplace().
INLINE Dirichlet::result_type gum::Dirichlet::operator() | ( | ) |
Returns a sample from the Dirichlet distribution.
Definition at line 76 of file Dirichlet_inl.h.
References gum::Set< Key, Alloc >::emplace().
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 94 of file Dirichlet_inl.h.
References gum::Set< Key, Alloc >::emplace().
result_type gum::Dirichlet::operator() | ( | URNG & | generator, |
const param_type & | p | ||
) |
Returns a sample from the Dirichlet distribution.
generator | A uniform random number generator object, used as the source of randomness. URNG shall be a uniform random number generator type, such as one of the standard generator classes. |
p | An object representing the distribution's parameters, obtained by a call to gum::Dirichlet::param(const param_type&). |
Copy operator.
from | The distribution to copy. |
Definition at line 56 of file Dirichlet_inl.h.
References gum::Set< Key, Alloc >::emplace().
Move operator.
from | The distribution to move. |
Definition at line 66 of file Dirichlet_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
noexcept |
Returns the parameters of the distribution.
Definition at line 112 of file Dirichlet_inl.h.
References gum::Set< Key, Alloc >::emplace().
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 115 of file Dirichlet_inl.h.
References gum::Set< Key, Alloc >::emplace().
|
private |
The gamma distribution used to compute the Dirichlet unnormalized samples.
Definition at line 174 of file Dirichlet.h.
|
private |
The random engine used by the unform random distribution.
Definition at line 170 of file Dirichlet.h.
|
private |
The parameters of the distribution.
Definition at line 177 of file Dirichlet.h.