Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FX::FXRandom Class Reference

FXRandom provides a thread-safe random number generator with a period of around 1.84E19. More...

#include <FXRandom.h>

List of all members.

Public Member Functions

 FXRandom ()
 Construct random generator with default seed value.
 FXRandom (FXulong s)
 Construct random generator with given seed s.
 FXRandom (const FXRandom &s)
 Initialize this random generator with the state of another.
FXRandomoperator= (const FXRandom &s)
 Assignment state from another random generator.
FXulong next ()
 Generate next state of the random generator.
void seed (FXulong s)
 Change state of random generator with new seed s.
FXulong getState () const
 Get state of random generator.
void setState (FXulong s)
 Set state of random generator.
FXulong randLong ()
 Draw random unsigned long, uniformly distributed.
FXfloat randFloat ()
 Draw random float, uniformly distributed between 0 and 1.
FXdouble randDouble ()
 Draw random double, uniformly distributed between 0 and 1.

Detailed Description

FXRandom provides a thread-safe random number generator with a period of around 1.84E19.


Constructor & Destructor Documentation

FX::FXRandom::FXRandom ( FXulong  s)

Construct random generator with given seed s.

A good source of seed values may be the FXThread::time() function.


Member Function Documentation

void FX::FXRandom::setState ( FXulong  s)
inline

Set state of random generator.

Ensure state is not zero!.


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

Copyright © 1997-2016 Jeroen van der Zijp