SatCat5
satcat5::util::Prng Class Referencefinal

Detailed Description

Simple cross-platform psuedorandom number generator (PRNG).

Generates uniform psuedorandom integer outputs.

Definition at line 370 of file utils.h.

#include <utils.h>

Public Member Functions

constexpr Prng (u64 seed=123456789ull)
 Constructor sets initial PRNG state.
 
u32 next ()
 Range [0..2^32)
 
u32 next (u32 mn, u32 mx)
 Range [mn..mx].
 
void seed (u64 seed)
 Reset to the provided PRNG state.
 

Protected Attributes

u64 m_state
 

The documentation for this class was generated from the following files: