85 _gamma_ = std::move(from._gamma_);
97 for (
Idx i = 0; i < size; ++i) {
98 _gamma_.param(std::gamma_distribution< float >::param_type(
_params_[i], 1));
103 for (
Idx i = 0; i < size; ++i) {
114 while (sum == 0.0f) {
115 for (
Idx i = 0; i < size; ++i) {
116 _gamma_.param(std::gamma_distribution< float >::param_type(parm[i], 1));
121 for (
Idx i = 0; i < size; ++i) {
~Dirichlet()
Class destructor.
Dirichlet & operator=(const Dirichlet &from)
Copy operator.
result_type operator()()
Returns a sample from the Dirichlet distribution.
std::gamma_distribution< float > _gamma_
The gamma distribution used to compute the Dirichlet unnormalized samples.
std::vector< float > param_type
The parameter type.
float max() const noexcept
Returns the lowest higher bound of the range of values returned by gum::Dirichlet::operator()().
Dirichlet(const param_type ¶ms)
Default constructor.
param_type _params_
The parameters of the distribution.
const param_type & param() const noexcept
Returns the parameters of the distribution.
std::vector< float > result_type
The type for the samples generated.
float min() const noexcept
Returns the greatest lower bound of the range of values returned by gum::Dirichlet::operator()().
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
std::mt19937 & randomGenerator()
define a random_engine with correct seed
gum is the global namespace for all aGrUM entities