32 #ifndef VSMC_RNG_ARS_HPP 33 #define VSMC_RNG_ARS_HPP 40 #ifndef VSMC_RNG_ARS_ROUNDS 41 #define VSMC_RNG_ARS_ROUNDS 5 46 #ifndef VSMC_RNG_ARS_BLOCKS 47 #define VSMC_RNG_ARS_BLOCKS 4 56 template <std::
size_t>
61 UINT64_C(0x9E3779B97F4A7C15)>
67 UINT64_C(0xBB67AE8584CAA73B)>
79 template <std::
size_t I>
90 using key_type = std::array<T, M128I<T>::size()>;
94 template <
typename U, std::
size_t Rp1>
97 M128I<std::uint64_t> weyl;
100 std::get<0>(rk).load(key.data());
101 generate<1>(rk, weyl, std::integral_constant<bool, 1 < Rp1>());
105 template <std::
size_t,
typename U, std::
size_t Rp1>
106 void generate(std::array<M128I<U>, Rp1> &,
const M128I<std::uint64_t> &,
107 std::false_type)
const 111 template <std::
size_t N,
typename U, std::
size_t Rp1>
112 void generate(std::array<M128I<U>, Rp1> &rk,
113 const M128I<std::uint64_t> &weyl, std::true_type)
const 116 _mm_add_epi64(std::get<N - 1>(rk).value(), weyl.value());
117 generate<N + 1>(rk, weyl, std::integral_constant<bool, N + 1 < Rp1>());
180 #endif // VSMC_RNG_ARS_HPP
Counter based RNG engine.
std::array< T, M128I< T >::size()> key_type
#define VSMC_RNG_ARS_ROUNDS
ARSEngine default rounds.
ARSEngine Weyl sequence constants.
void operator()(const key_type &key, std::array< M128I< U >, Rp1 > &rk) const
void reset(const key_type &)
#define VSMC_RNG_ARS_BLOCKS
ARSEngine default blocks.
Default ARSEngine key sequence generator.