Loading...
Searching...
No Matches
etl::random_lcg Class Reference

`#include <random.h>`

## Public Member Functions

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

## Detailed Description

A 32 bit random number generator. Uses a linear congruential generator. https://cs.adelaide.edu.au/~paulc/teaching/montecarlo/node107.html

## Constructor & Destructor Documentation

## random_lcg() [1/2]

etl::random_lcg::random_lcg | ( |  | ) |

inline

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

## random_lcg() [2/2]

etl::random_lcg::random_lcg | ( | uint32_t | seed | ) |

inline

Constructor with seed value.

Parameters

  seed | The new seed value.

## Member Function Documentation

## initialise()

void etl::random_lcg::initialise | ( | uint32_t | seed | ) |

inline

Initialises the sequence with a new seed value.

Parameters

  seed | The new seed value.

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

- include/etl/random.h