Definition at line 17 of file mozzi_rand_p.h.
Static Public Member Functions | |
| static uint32_t | xorshift96 () |
| static void | autoSeed () |
Friends | |
| void | randSeed () |
| Initialises Mozzi's (pseudo)random number generator xorshift96(), which is used in Mozzi's rand() function. More... | |
| void | randSeed (uint32_t) |
| Initialises Mozzi's (pseudo)random number generator xorshift96(), which is used in Mozzi's rand() function. More... | |
| uint32_t | xorshift96 () |
| Random number generator. More... | |
|
friend |
Initialises Mozzi's (pseudo)random number generator xorshift96(), which is used in Mozzi's rand() function.
This can be useful if you want random sequences to be different on each run of a sketch, by seeding with a fairly random input. randSeed() called without a parameter uses noise from reading the Arduino's internal temperature as the seed, a technique discussed at http://arduino.cc/forum/index.php/topic,38091.0.html, borrowing code put there by Rob Tillaart.
Definition at line 59 of file mozzi_rand.h.
|
friend |
Initialises Mozzi's (pseudo)random number generator xorshift96(), which is used in Mozzi's rand() function.
This can be useful if you want random sequences to be different on each run of a sketch, by seeding with fairly random input, such as analogRead() on an unconnected pin (as explained in the Arduino documentation for randomSeed(). randSeed is the same as xorshift96Seed(), but easier to remember.
| seed | a number to use as a seed. |
Definition at line 43 of file mozzi_rand_p.h.
|
friend |
Random number generator.
A faster replacement for Arduino's random function, which is too slow to use with Mozzi. Based on Marsaglia, George. (2003). Xorshift RNGs. http://www.jstatsoft.org/v08/i14/xorshift.pdf
Definition at line 30 of file mozzi_rand.h.