32 #ifndef VSMC_RNG_EXTREME_VALUE_DISTRIBUTION_HPP 33 #define VSMC_RNG_EXTREME_VALUE_DISTRIBUTION_HPP 44 template <
typename RealType>
54 template <
typename RealType>
64 return -std::numeric_limits<result_type>::max
VSMC_MNE();
69 return std::numeric_limits<result_type>::max
VSMC_MNE();
75 template <
typename RNGType>
87 template <
typename RealType,
typename RNGType>
89 RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
93 mul(n, static_cast<RealType>(-1), r, r);
102 template <
typename RealType,
typename RNGType>
104 RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
106 const std::size_t k = 1000;
107 const std::size_t m = n / k;
108 const std::size_t l = n % k;
109 for (std::size_t i = 0; i != m; ++i)
114 template <
typename RealType,
typename RNGType>
116 std::size_t n, RealType *r)
123 #endif // VSMC_RNG_EXTREME_VALUE_DISTRIBUTION_HPP
Standard uniform distribution with open/closed variants.
void mul(std::size_t n, const float *a, const float *b, float *y)
ExtremeValue distribution.
void extreme_value_distribution_impl(RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
void u01_oo_distribution(RNGType &rng, std::size_t n, RealType *r)
Generate standard uniform random variates on open-open interval.
void rng_rand(RNGType &rng, BernoulliDistribution< IntType > &dist, std::size_t n, IntType *r)
#define VSMC_DEFINE_RNG_DISTRIBUTION_OPERATORS
#define VSMC_DEFINE_RNG_DISTRIBUTION_2(Name, name, T, T1, p1, v1, T2, p2, v2)
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 .
void log(std::size_t n, const float *a, float *y)
bool extreme_value_distribution_check_param(RealType, RealType b)