ORTS
Public Member Functions | Private Attributes | Static Private Attributes

Random Class Reference

#include <Random.H>

List of all members.

Public Member Functions

 Random ()
 Random (uint4 seed)
void srand (uint4)
void lsrand (uint4[], sint4)
uint4 rand_uint4 ()
real8 rand_real8 ()
uint4 ranged_uint4 (uint4 minimum, uint4 maximum)
uint4 ranged_sint4 (sint4 minimum, sint4 maximum)
uint4 operator() (uint4 n)

Private Attributes

uint4 mt [N]
sint4 mti

Static Private Attributes

static const sint4 N = 624
static const sint4 M = 397
static const uint4 MATRIX_A = 0x9908b0dfUL
static const uint4 UPPER_MASK = 0x80000000UL
static const uint4 LOWER_MASK = 0x7fffffffUL

Detailed Description

Definition at line 10 of file Random.H.


Constructor & Destructor Documentation

Random::Random ( ) [inline]

Definition at line 14 of file Random.H.

Random::Random ( uint4  seed) [inline]

Definition at line 15 of file Random.H.

References srand().


Member Function Documentation

void Random::lsrand ( uint4  init_key[],
sint4  key_length 
)

Definition at line 89 of file Random.C.

References max_sint4, max_uint4, mt, and N.

uint4 Random::operator() ( uint4  n) [inline]

Definition at line 23 of file Random.H.

References assert(), and rand_uint4().

real8 Random::rand_real8 ( )

Definition at line 157 of file Random.C.

uint4 Random::rand_uint4 ( )
uint4 Random::ranged_sint4 ( sint4  minimum,
sint4  maximum 
)

Definition at line 175 of file Random.C.

References ERR, and max_uint4.

Referenced by GatherCommander::moveRandomly().

uint4 Random::ranged_uint4 ( uint4  minimum,
uint4  maximum 
)

Definition at line 163 of file Random.C.

References ERR, and max_uint4.

void Random::srand ( uint4  s)

Member Data Documentation

const uint4 Random::LOWER_MASK = 0x7fffffffUL [static, private]

Definition at line 31 of file Random.H.

const sint4 Random::M = 397 [static, private]

Definition at line 28 of file Random.H.

const uint4 Random::MATRIX_A = 0x9908b0dfUL [static, private]

Definition at line 29 of file Random.H.

uint4 Random::mt[N] [private]

Definition at line 33 of file Random.H.

sint4 Random::mti [private]

Definition at line 34 of file Random.H.

const sint4 Random::N = 624 [static, private]

Definition at line 27 of file Random.H.

const uint4 Random::UPPER_MASK = 0x80000000UL [static, private]

Definition at line 30 of file Random.H.


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


Generated on Fri May 18 2012 03:03:05 for ORTS by Doxygen1.7.3