1#ifndef ROSE_LinearCongruentialGenerator_H 
    2#define ROSE_LinearCongruentialGenerator_H 
   24    void reseed(
int seed) { value_ = seed_ = seed; }
 
   27    int seed()
 const { 
return seed_; }
 
   30    uint64_t 
again()
 const { 
return value_; }
 
   40    uint64_t 
next(
size_t nbits=64, 
size_t niter=1);
 
 
Linear congruential generator.
 
bool flip_coin()
Return a random boolean value.
 
LinearCongruentialGenerator(int seed)
Initialize the generator with a seed.
 
void init()
Random initialization.
 
uint64_t again() const
Return the last returned value again.
 
uint64_t next(size_t nbits=64, size_t niter=1)
Return the next value in the sequence.
 
uint64_t max()
Return the maximum possible value.
 
uint64_t operator()()
Return the next value in the sequence.
 
int seed() const
Return the seed for the current sequence.
 
void reset()
Reset the sequence back to the first value.
 
void reseed(int seed)
Start a new sequence of random values.
 
LinearCongruentialGenerator()
Initialize the generator with a random seed.