32 #ifndef VSMC_RNG_EXPONENTIAL_DISTRIBUTION_HPP 33 #define VSMC_RNG_EXPONENTIAL_DISTRIBUTION_HPP 44 template <
typename RealType>
54 template <
typename RealType>
68 template <
typename RNGType>
80 template <std::
size_t,
typename RealType,
typename RNGType>
82 RNGType &rng, std::size_t n, RealType *r, RealType lambda)
86 mul(n, -1 / lambda, r, r);
98 #endif // VSMC_RNG_EXPONENTIAL_DISTRIBUTION_HPP void exponential_distribution_impl(RNGType &rng, std::size_t n, RealType *r, RealType lambda)
#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_1(name, p1)
void mul(std::size_t n, const float *a, const float *b, float *y)
bool exponential_distribution_check_param(RealType lambda)
Standard uniform distribution on (0, 1].
RealType u01(UIntType u) noexcept
Convert uniform unsigned integers to floating points within [0, 1].
result_type lambda() const
Exponential distribution.
#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_0
void u01_oc_distribution(RNGType &rng, std::size_t n, RealType *r)
Generate standard uniform random variates on (0, 1].
void log(std::size_t n, const float *a, float *y)
#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_1(Name, name, p1)
#define VSMC_DEFINE_RNG_DISTRIBUTION_1(Name, name, p1, v1)