32 #ifndef VSMC_RNG_EXTREME_VALUE_DISTRIBUTION_HPP 33 #define VSMC_RNG_EXTREME_VALUE_DISTRIBUTION_HPP 44 template <
typename RealType>
54 template <
typename RealType>
62 return std::numeric_limits<result_type>::lowest();
70 template <
typename RNGType>
82 template <
typename RealType,
typename RNGType>
84 RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
88 mul(n, static_cast<RealType>(-1), r, r);
97 template <
typename RealType,
typename RNGType>
99 RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
101 static_assert(std::is_floating_point<RealType>::value,
102 "**extreme_value_distribution** USED WITH RealType OTHER THAN " 103 "FLOATING POINT TYPES");
105 const std::size_t k = 1024;
106 const std::size_t m = n / k;
107 const std::size_t l = n % k;
108 for (std::size_t i = 0; i != m; ++i, r += k)
117 #endif // VSMC_RNG_EXTREME_VALUE_DISTRIBUTION_HPP
void mul(std::size_t n, const float *a, const float *b, float *y)
#define VSMC_DEFINE_RNG_DISTRIBUTION_2(Name, name, p1, v1, p2, v2)
ExtremeValue distribution.
void extreme_value_distribution_impl(RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
void u01_distribution(RNGType &, std::size_t, RealType *)
Generate standard uniform random variates.
void extreme_value_distribution(RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
Generating extreme_value random variates.
void fma(std::size_t n, const T *a, const T *b, const T *c, T *y)
For , compute .
Standard uniform distribution.
#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_2(Name, name, p1, p2)
void log(std::size_t n, const float *a, float *y)
bool extreme_value_distribution_check_param(RealType, RealType b)