32 #ifndef VSMC_RNG_LOGNORMAL_DISTRIBUTION_HPP 33 #define VSMC_RNG_LOGNORMAL_DISTRIBUTION_HPP 44 template <
typename RealType>
54 template <
typename RealType>
66 return std::numeric_limits<result_type>::max
VSMC_MNE();
74 template <
typename RNGType>
77 return std::exp(param.
m() + param.
s() * normal_(rng));
84 template <
typename RealType,
typename RNGType>
86 RNGType &rng, std::size_t n, RealType *r, RealType m, RealType s)
96 template <
typename RealType,
typename RNGType>
98 RealType logmean, RealType logstddev)
100 const std::size_t k = 1000;
101 const std::size_t m = n / k;
102 const std::size_t l = n % k;
103 for (std::size_t i = 0; i != m; ++i, r += k)
108 template <
typename RealType,
typename RNGType>
110 std::size_t n, RealType *r)
117 #endif // VSMC_RNG_LOGNORMAL_DISTRIBUTION_HPP
void lognormal_distribution(RNGType &, std::size_t, RealType *, RealType, RealType)
Generating lognormal random variates.
void lognormal_distribution_impl(RNGType &rng, std::size_t n, RealType *r, RealType m, RealType s)
void rng_rand(RNGType &rng, BernoulliDistribution< IntType > &dist, std::size_t n, IntType *r)
bool lognormal_distribution_check_param(RealType, RealType s)
#define VSMC_DEFINE_RNG_DISTRIBUTION_OPERATORS
void normal_distribution(RNGType &, std::size_t, RealType *, RealType, RealType)
Generating normal random variates.
#define VSMC_DEFINE_RNG_DISTRIBUTION_2(Name, name, T, T1, p1, v1, T2, p2, v2)
void exp(std::size_t n, const float *a, float *y)