32 #ifndef MCKL_RANDOM_U01_HPP 33 #define MCKL_RANDOM_U01_HPP 52 template <
typename UIntType,
typename RealType,
typename Lower,
typename Upper>
53 using U01Impl = U01AVX512Impl<UIntType, RealType, Lower, Upper>;
55 template <
typename UIntType,
typename RealType,
int M>
60 template <
typename UIntType,
typename RealType,
typename Lower,
typename Upper>
63 template <
typename UIntType,
typename RealType,
int M>
66 #else // MCKL_USE_AVX2 68 template <
typename UIntType,
typename RealType,
typename Lower,
typename Upper>
71 template <
typename UIntType,
typename RealType,
int M>
74 #endif // MCKL_USE_AVX2 87 template <
typename UIntType,
typename RealType,
typename Lower,
typename Upper>
88 inline RealType
u01(UIntType u)
90 static_assert(std::is_unsigned<UIntType>::value,
91 "**u01** used with UIntType other than unsigned integer " 94 static_assert(std::is_floating_point<RealType>::value,
95 "**u01** used with RealType other than floating point " 103 template <
typename UIntType,
typename RealType,
typename Lower,
typename Upper>
104 inline void u01(std::size_t n,
const UIntType *u, RealType *r)
106 static_assert(std::is_unsigned<UIntType>::value,
107 "**u01** used with UIntType other than unsigned integer " 110 static_assert(std::is_floating_point<RealType>::value,
111 "**u01** used with RealType other than floating point " 119 template <
typename UIntType,
typename RealType>
122 return u01<UIntType, RealType, Closed, Closed>(u);
127 template <
typename UIntType,
typename RealType>
130 return u01<UIntType, RealType, Closed, Open>(u);
135 template <
typename UIntType,
typename RealType>
138 return u01<UIntType, RealType, Open, Closed>(u);
143 template <
typename UIntType,
typename RealType>
146 return u01<UIntType, RealType, Open, Open>(u);
151 template <
typename UIntType,
typename RealType>
152 inline void u01_cc(std::size_t n,
const UIntType *u, RealType *r)
154 u01<UIntType, RealType, Closed, Closed>(n, u, r);
159 template <
typename UIntType,
typename RealType>
160 inline void u01_co(std::size_t n,
const UIntType *u, RealType *r)
162 u01<UIntType, RealType, Closed, Open>(n, u, r);
167 template <
typename UIntType,
typename RealType>
168 inline void u01_oc(std::size_t n,
const UIntType *u, RealType *r)
170 u01<UIntType, RealType, Open, Closed>(n, u, r);
175 template <
typename UIntType,
typename RealType>
176 inline void u01_oo(std::size_t n,
const UIntType *u, RealType *r)
178 u01<UIntType, RealType, Open, Open>(n, u, r);
184 template <
typename UIntType,
typename RealType, std::
size_t M>
187 static_assert(std::is_unsigned<UIntType>::value,
188 "**u01_canonical** used with UIntType other than unsigned integer " 191 static_assert(std::is_floating_point<RealType>::value,
192 "**u01_canonical** used with RealType other than floating point " 201 template <
typename UIntType,
typename RealType, std::
size_t M>
204 static_assert(std::is_unsigned<UIntType>::value,
205 "**u01_canonical** used with UIntType other than unsigned integer " 208 static_assert(std::is_floating_point<RealType>::value,
209 "**u01_canonical** used with RealType other than floating point " 217 #endif // MCKL_RANDOM_U01_HPP U01CanonicalAVX2Impl< UIntType, RealType, M > U01CanonicalImpl
U01AVX2Impl< UIntType, RealType, Lower, Upper > U01Impl
RealType u01_cc(UIntType u)
Convert uniform unsigned integers to floating points on [0, 1].
RealType u01_oc(UIntType u)
Convert uniform unsigned integers to floating points on (0, 1].
RealType u01(UIntType u)
Convert uniform unsigned integers to floating points within [0, 1].
static RealType eval(const UIntType *u)
RealType u01_co(UIntType u)
Convert uniform unsigned integers to floating points on [0, 1)
RealType u01_canonical(const UIntType *u)
Convert uniform multiple unsigned integers to one floating points within [0, 1].
RealType u01_oo(UIntType u)
Convert uniform unsigned integers to floating points on (0, 1)