Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
random_lsfr Class Reference
A 32 bit random number generator. More...
#include <random.h>
Inherits etl::random.
Public Member Functions | |
| random_lsfr () | |
| Default constructor. | |
| random_lsfr (uint32_t seed) | |
| Constructor with seed value. | |
| void | initialise (uint32_t seed) |
| Initialises the sequence with a new seed value. | |
| uint32_t | operator() () |
| Get the next random_lsfr number. | |
| uint32_t | range (uint32_t low, uint32_t high) |
| Get the next random_lsfr number in a specified inclusive range. | |
Detailed Description
A 32 bit random number generator.
Uses a linear shift feedback register. https://en.wikipedia.org/wiki/Linear-feedback_shift_register
Definition at line 131 of file random.h.
Constructor & Destructor Documentation
| random_lsfr | ( | ) |
Default constructor.
Attempts to come up with a unique non-zero seed.
Definition at line 236 of file random.cpp.
| random_lsfr | ( | uint32_t | seed ) | [explicit] |
Constructor with seed value.
- Parameters:
-
seed The new seed value.
Definition at line 249 of file random.cpp.
Member Function Documentation
| void initialise | ( | uint32_t | seed ) | [virtual] |
Initialises the sequence with a new seed value.
- Parameters:
-
seed The new seed value.
Implements random.
Definition at line 258 of file random.cpp.
| uint32_t operator() | ( | ) | [virtual] |
| uint32_t range | ( | uint32_t | low, |
| uint32_t | high | ||
| ) | [virtual] |
Get the next random_lsfr number in a specified inclusive range.
Implements random.
Definition at line 283 of file random.cpp.
Generated on Tue Jul 12 2022 14:05:53 by
1.7.2