Main Page | Class List | Directories | File List | Class Members | File Members

random.h File Reference

Random number library. More...

#include "mdapi/mdtypes.h"

Go to the source code of this file.

Classes

struct  Random_tag
 Random number class. More...

Typedefs

typedef long long int64
typedef Random_tag Random
 Random number class.

Functions

void random_init (Random *r)
 Constructor.
void random_initseed (Random *r, unsigned long seed)
 Constructor.
void random_split (Random *r, int iStream, int numStreams)
 Split streams.
double random_uniform (Random *r)
 Uniform distribution.
double random_gaussian (Random *r)
 Gaussian distribution.
MD_Dvec random_gaussian_vector (Random *r)
 Vector of Gaussian random numbers.
long random_integer (Random *r)
 Random integer.


Detailed Description

Random number library.

Author:
Martin Birgmeier
Date:
1993
The Random_tag class is a linear congruential generator for a pseudo-random number stream. The functional portion of the code, originally by Martin Birgmeier, is taken from NAMD. It has been turned into a class to provide thread-safe use.

Typedef Documentation

typedef struct Random_tag Random
 

Random number class.

Members should be treated as private. Stores random sequence state.


Function Documentation

double random_gaussian Random r  ) 
 

Gaussian distribution.

Determine a random number from a standard Gaussian distribution.

Returns:
the random number.

MD_Dvec random_gaussian_vector Random r  ) 
 

Vector of Gaussian random numbers.

Generate a 3-vector of Gaussian random numbers.

Returns:
the random vector.

void random_init Random r  ) 
 

Constructor.

Initializes random sequence using a seed of 0.

void random_initseed Random r,
unsigned long  seed
 

Constructor.

Parameters:
[in] seed Seeds random sequence.
Initializes random sequence using specified seed.

long random_integer Random r  ) 
 

Random integer.

Generate a random integer.

Returns:
the random integer.

void random_split Random r,
int  iStream,
int  numStreams
 

Split streams.

Parameters:
[in] iStream Identifies stream to take.
[in] numStreams Indicates number of streams.
Split into numStreams number of streams and take stream numbered iStream.

double random_uniform Random r  ) 
 

Uniform distribution.

Determine a random number uniformly distributed between 0 and 1.

Returns:
the random number.


Generated on Mon Sep 26 10:55:19 2005 for MDX by  doxygen 1.4.4