Marine systems simulation
Loading...
Searching...
No Matches
marenv::calc::LcgRandomTrunc Class Reference

Generation of very simple pseudo-random numbers.

#include <LcgRandom.h>

+ Inheritance diagram for marenv::calc::LcgRandomTrunc:
+ Collaboration diagram for marenv::calc::LcgRandomTrunc:

Public Member Functions

 LcgRandomTrunc (uint32_t seed=0)
 
uint32_t rnd ()
 
- Public Member Functions inherited from marenv::calc::LcgRandomBase
void seed (uint32_t s)
 

Additional Inherited Members

- Protected Member Functions inherited from marenv::calc::LcgRandomBase
 LcgRandomBase (uint32_t seed)
 
uint32_t rnd ()
 
- Protected Attributes inherited from marenv::calc::LcgRandomBase
uint32_t _seed
 The current seed (changed for each random number generation).
 
uint32_t a
 Integer used in the generation of next random number.
 
uint32_t c
 Integer used in the generation of next random number.
 
uint32_t m
 Integer used in the generation of next random number.
 

Constructor & Destructor Documentation

◆ LcgRandomTrunc()

marenv::calc::LcgRandomTrunc::LcgRandomTrunc ( uint32_t  seed = 0)

Constructs the random number generator with a seed number

Parameters
[in]seedThe seed number

Member Function Documentation

◆ rnd()

uint32_t marenv::calc::LcgRandomTrunc::rnd ( )

Get random integer between 0 and 4294967295

Returns
Random integer between 0 and 4294967295

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