3-phase PV router
Loading...
Searching...
No Matches
SimpleRNG Class Reference

Simple deterministic PRNG (xorshift32) for reproducible noise. More...

Public Member Functions

 SimpleRNG (uint32_t seed=12345)
 
uint32_t next ()
 
int16_t noise (int16_t amplitude)
 Generate noise in range [-amplitude, +amplitude].
 
void seed (uint32_t s)
 

Private Attributes

uint32_t state
 

Detailed Description

Simple deterministic PRNG (xorshift32) for reproducible noise.

Definition at line 258 of file test_main.cpp.

Constructor & Destructor Documentation

◆ SimpleRNG()

SimpleRNG::SimpleRNG ( uint32_t seed = 12345)
inlineexplicit

Definition at line 263 of file test_main.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ next()

uint32_t SimpleRNG::next ( )
inline

Definition at line 271 of file test_main.cpp.

Here is the caller graph for this function:

◆ noise()

int16_t SimpleRNG::noise ( int16_t amplitude)
inline

Generate noise in range [-amplitude, +amplitude].

Definition at line 282 of file test_main.cpp.

Here is the call graph for this function:

◆ seed()

void SimpleRNG::seed ( uint32_t s)
inline

Definition at line 266 of file test_main.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ state

uint32_t SimpleRNG::state
private

Definition at line 260 of file test_main.cpp.


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