pseudorandomsource(3)
NAME
PseudoRandomSource - this class serves as a source of reproducible
(pseudo-)random numbers
SYNOPSIS
#include <PseudoRandomSource.h> Public Member Functions PseudoRandomSource (UWORD32 s) UWORD32 getValue (UWORD32 n) Private Attributes UWORD32 Value Static Private Attributes static const UWORD32 A = 1367208549 static const UWORD32 C = 1
Detailed Description
To generate the random numbers, the linear congruetial method is used.
2^32 is used as modulus. The overflow in the implementation is intended
(and controlled, as UWORD32 is used as datatype which always is 32 bits
wide).
Constructor & Destructor Documentation
- PseudoRandomSource::PseudoRandomSource (UWORD32 s) [inline]
- construct a PseudoRandomSource object
- Parameters:
s the seed
Member Function Documentation
- UWORD32 PseudoRandomSource::getValue (UWORD32 n)
- get a pseudo-random value from {0,...,n-1}
- Parameters:
n the range of the random value to be returned
- Returns:
a number >= 0 and <= n - 1
- After calling getValue, the next getValue call will use the next state of the random number generator (analogous to the C rand() function)
Member Data Documentation
const UWORD32 PseudoRandomSource::A = 1367208549 [static, private] const UWORD32 PseudoRandomSource::C = 1 [static, private] UWORD32 PseudoRandomSource::Value [private]
Author
- Generated automatically by Doxygen for steghide from the source code.