86 void Reseed(std::uint64_t master, std::uint64_t domain, std::uint64_t index);
111 unsigned char NextByte();
114 std::uint64_t counter_ = 0;
115 unsigned char block_[32];
116 unsigned offset_ = 32;
117 bool seeded_ =
false;
A deterministic, fully-specified random stream (SHA-256 counter mode).
Definition derive.hpp:78
double UnitDouble()
Uniform on [0,1), exactly 53 bits: (Uint64 >> 11) * 2^-53.
real_mp UnitRealMp(unsigned digits)
Uniform on [0,1) at digits decimal digits: ldexp(Bits(k), -k) with k = ceil(digits*log2(10)) + 1,...
DrawStream()=default
Construct unseeded; the first draw self-seeds from entropy (unseeded runs stay random).
mpz_int IntSymmetric(mpz_int const &bound)
Uniform integer on [-bound, bound], by rejection over Bits(bitlen(2*bound)).
std::uint64_t Uint64()
The next 8 stream bytes as a big-endian unsigned 64-bit integer.
mpz_int Bits(unsigned num_bits)
The next n bits as a nonnegative integer (big-endian bytes, masked).
double SymmetricDouble()
Uniform on [-1,1]: 2*UnitDouble() - 1 (both operations exact).
void Reseed(std::uint64_t master, std::uint64_t domain, std::uint64_t index)
Rekey the stream from (master seed, domain tag, stream index) under b2rand/1 and restart its counter.
Dependency-free declarations of the pinned draw primitives (ADR-0044).
Extensions to the Boost.Multiprecision library.
Definition config_encoding.hpp:66
DrawStream & ThreadDrawStream()
This thread's pinned draw stream — the source of every identity-relevant random draw in bertini2.
constexpr char RandomDerivationVersion[]
The version tag of the draw-derivation scheme; bump on any algorithm change.
Definition derive.hpp:68
Definition algorithm_builder.hpp:36
boost::multiprecision::number< boost::multiprecision::backends::gmp_int, boost::multiprecision::et_on > mpz_int
The arbitrary-precision integer type.
Definition mpfr_extensions.hpp:54
boost::multiprecision::number< boost::multiprecision::mpfr_float_backend< 0 >, boost::multiprecision::et_on > real_mp
The arbitrary-precision real number type.
Definition mpfr_extensions.hpp:53
Self-contained SHA-256 (FIPS 180-4) and the Digest256 value type.
A 256-bit content digest – the output of Sha256, used as a persistent identity key.
Definition sha256.hpp:53