Commit 922ae864 authored by Christoph Conrads's avatar Christoph Conrads

Fix add-with-carry PRNG index computation

parent 48d538fd
......@@ -225,7 +225,7 @@ struct add_with_carry_engine
}
index_ = long_lag == 8 or long_lag == 16 or long_lag == 32
? (index_ + 1u) & long_lag
? (index_ + 1u) & (long_lag-1u)
: index_ + 1u == long_lag ? 0u : index_ + 1u
;
......@@ -325,7 +325,7 @@ struct subtract_with_borrow_engine
}
index_ = long_lag == 8 or long_lag == 16 or long_lag == 32
? (index_ + 1u) & long_lag
? (index_ + 1u) & (long_lag-1u)
: index_ + 1u == long_lag ? 0u : index_ + 1u
;
......@@ -356,7 +356,7 @@ using ranlux16 = std::discard_block_engine<ranlux16_base, 97u, 9u>;
using fast_ranlux16 = std::discard_block_engine<ranlux16_base, 23u, 9u>;
using ranlux32_base = add_with_carry_engine<std::uint32_t, 32u, 3u, 16u>;
using ranlux32 = std::discard_block_engine<ranlux32_base, 277u, 16u>;
using ranlux32 = std::discard_block_engine<ranlux32_base, 389u, 16u>;
using fast_ranlux32 = std::discard_block_engine<ranlux32_base, 71u, 16u>;
using ranlux64_base = subtract_with_borrow_engine<std::uint64_t, 64u, 62u, 3u>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment