Pseudro-Random Number Generator based on a 32-bit linear-feedback shift register.
More...
#include <mn_random_lfsr.hpp>
Pseudro-Random Number Generator based on a 32-bit linear-feedback shift register.
- Note
- For reference, the implementation is based on the Maxim IC application note "AN4000" http://www.maximintegrated.com/app-notes/index.mvp/id/4400
- Author
- Amber-Sophia Schröck
◆ basic_random_lfsr()
mn::basic_random_lfsr::basic_random_lfsr |
( |
unsigned int |
startSeed = 0xFEABDC72 , |
|
|
unsigned int |
polyMask = 0xA1B3C6DF |
|
) |
| |
|
inline |
◆ get_polymask()
unsigned int mn::basic_random_lfsr::get_polymask |
( |
| ) |
|
|
inline |
Get the polymask.
- Returns
- The polymask
◆ rand16()
unsigned short basic_random_lfsr::rand16 |
( |
| ) |
|
|
overridevirtual |
◆ rand32()
unsigned int basic_random_lfsr::rand32 |
( |
| ) |
|
|
overridevirtual |
◆ rand8()
unsigned char basic_random_lfsr::rand8 |
( |
| ) |
|
|
overridevirtual |
◆ set_polymask()
void mn::basic_random_lfsr::set_polymask |
( |
unsigned int |
mask | ) |
|
|
inline |
Set the a new polymask.
- Parameters
-
◆ set_seed()
void mn::basic_random_lfsr::set_seed |
( |
unsigned int |
seed, |
|
|
unsigned int |
mask |
|
) |
| |
|
inline |
Set a new seed, with new polymask.
- Parameters
-
seed | The new seed |
mask | The new polymask |
◆ m_uiPolyMask
unsigned int mn::basic_random_lfsr::m_uiPolyMask |
|
private |
The documentation for this class was generated from the following files: