32 #ifndef VSMC_RNG_PARETO_DISTRIBUTION_HPP 33 #define VSMC_RNG_PARETO_DISTRIBUTION_HPP 44 template <
typename RealType>
47 return a > 0 && b > 0;
54 template <
typename RealType>
66 return std::numeric_limits<result_type>::max
VSMC_MNE();
72 template <
typename RNGType>
84 template <std::
size_t K,
typename RealType,
typename RNGType>
86 RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
97 template <
typename RealType,
typename RNGType>
99 RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
101 const std::size_t k = 1000;
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)
105 internal::pareto_distribution_impl<k>(rng, k, r + i * k, a, b);
106 internal::pareto_distribution_impl<k>(rng, l, r + m * k, a, b);
109 template <
typename RealType,
typename RNGType>
111 std::size_t n, RealType *r)
118 #endif // VSMC_RNG_PARETO_DISTRIBUTION_HPP bool pareto_distribution_check_param(RealType a, RealType b)
Standard uniform distribution with open/closed variants.
void mul(std::size_t n, const float *a, const float *b, float *y)
void rng_rand(RNGType &rng, BernoulliDistribution< IntType > &dist, std::size_t n, IntType *r)
void exponential_distribution(RNGType &rng, std::size_t n, RealType *r, RealType lambda)
Generating exponential random variates.
#define VSMC_DEFINE_RNG_DISTRIBUTION_OPERATORS
void pareto_distribution(RNGType &, std::size_t, RealType *, RealType, RealType)
Generating pareto 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)
void pareto_distribution_impl(RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
void log(std::size_t n, const float *a, float *y)