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

TRandom Class Reference

A wrapper class for random number generation. More...

#include <random.h>

List of all members.

Static Public Methods

double getDouble ()
int getInitNumber ()
int getInteger (int max)
int getMaxRandomNumber ()
void initialize ()
void initialize (int init)

Static Private Attributes

int fRandInit


Detailed Description

A wrapper class for random number generation.

Author:
Marco Krohn <marco.krohn@gmx.de>
Version:
Id:
random.h,v 1.4 2002/03/24 13:24:10 mkrohn5 Exp

A wrapper class for random number generations using the standard C routines.


Member Function Documentation

double TRandom::getDouble   [static]
 

Returns:
Returns the next double value. The returned values are elements of the closed interval [0, 1] (this means that 0 and 1 are possible values).

int TRandom::getInitNumber   [static]
 

Returns:
The initialization number for the random number generation.

int TRandom::getInteger int    max [static]
 

FIXME: test if the distribution is o.k., I am not sure

Parameters:
max  The highest possible value _plus_ one.
Returns:
Returns an integer of the (closed) interval [0, max -1].

int TRandom::getMaxRandomNumber   [static]
 

Returns:
The max. possible random number (simply returns the constant RAND_MAX which is defined in stdlib.h)

void TRandom::initialize int    init [static]
 

Initializes the random number generator.

Parameters:
init  The parameter which is used for initialization of the random number generator.

void TRandom::initialize   [static]
 

Initializes the random number generator using the current time.


The documentation for this class was generated from the following file:
Generated on Thu Jun 20 18:13:30 2002 for Stellar Legacy by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001