Home | History | Annotate | Download | only in util

Lines Matching defs:seed_

17   uint32_t seed_;
19 explicit Random(uint32_t s) : seed_(s & 0x7fffffffu) {
21 if (seed_ == 0 || seed_ == 2147483647L) {
22 seed_ = 1;
29 // seed_ = (seed_ * A) % M, where M = 2^31-1
31 // seed_ must not be zero or M, or else all subsequent computed values
32 // will be zero or M respectively. For all other values, seed_ will end
34 uint64_t product = seed_ * A;
37 seed_ = static_cast<uint32_t>((product >> 31) + (product & M));
41 if (seed_ > M) {
42 seed_ -= M;
44 return seed_;