32 #ifndef VSMC_RNG_RAYLEIGH_DISTRIBUTION_HPP 33 #define VSMC_RNG_RAYLEIGH_DISTRIBUTION_HPP 44 template <
typename RealType>
54 template <
typename RealType>
67 template <
typename RNGType>
79 template <
typename RealType,
typename RNGType>
81 RNGType &rng, std::size_t n, RealType *r, RealType sigma)
85 mul(n, -2 * sigma * sigma, r, r);
93 template <
typename RealType,
typename RNGType>
95 RNGType &rng, std::size_t n, RealType *r, RealType sigma)
97 static_assert(std::is_floating_point<RealType>::value,
98 "**rayleigh_distribution** USED WITH RealType OTHER THAN FLOATING " 101 const std::size_t k = 1024;
102 const std::size_t m = n / k;
103 const std::size_t l = n % k;
104 for (std::size_t i = 0; i != m; ++i, r += k)
113 #endif // VSMC_RNG_RAYLEIGH_DISTRIBUTION_HPP
void mul(std::size_t n, const float *a, const float *b, float *y)
void sqrt(std::size_t n, const float *a, float *y)
result_type sigma() const
void u01_distribution(RNGType &, std::size_t, RealType *)
Generate standard uniform random variates.
void rayleigh_distribution(RNGType &, std::size_t, RealType *, RealType)
Generating rayleigh random variates.
bool rayleigh_distribution_check_param(RealType sigma)
void rayleigh_distribution_impl(RNGType &rng, std::size_t n, RealType *r, RealType sigma)
Standard uniform distribution.
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)