Embedded Template Library 1.0
etl::random_xorshift Class Reference

#include <random.h>

Public Member Functions

 random_xorshift ()
 
 random_xorshift (uint32_t seed)
 
void initialise (uint32_t seed)
 
uint32_t operator() ()
 Get the next random_xorshift number.
 
uint32_t range (uint32_t low, uint32_t high)
 Get the next random_xorshift number in a specified inclusive range.
 

Detailed Description

A 32 bit random number generator. Uses a 128 bit XOR shift algorithm. https://en.wikipedia.org/wiki/Xorshift

Constructor & Destructor Documentation

◆ random_xorshift() [1/2]

etl::random_xorshift::random_xorshift ( )
inline

Default constructor. Attempts to come up with a unique non-zero seed.

◆ random_xorshift() [2/2]

etl::random_xorshift::random_xorshift ( uint32_t  seed)
inline

Constructor with seed value.

Parameters
seedThe new seed value.

Member Function Documentation

◆ initialise()

void etl::random_xorshift::initialise ( uint32_t  seed)
inline

Initialises the sequence with a new seed value.

Parameters
seedThe new seed value.

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