ls1-MarDyn
ls1-MarDyn molecular dynamics code
Public Member Functions | List of all members
Random Class Reference

#include <Random.h>

Public Member Functions

 Random (int seed=8624)
 
void init (int seed)
 
float rnd ()
 
float uniformRandInRange (float a, float b)
 
int getIX ()
 
double gaussDeviate (double stdDeviation)
 

Detailed Description

Uniform (quasi)-random number generator class.

Minimal random number generator of Park and Miller combinmed with a Marsaglia shift sequence. (see Numerical Recipies in Fortran 90: The Art of Parallel Scientific Computing, Chapter B7)

Member Function Documentation

◆ gaussDeviate()

double Random::gaussDeviate ( double  stdDeviation)

returns a gaussian distributed deviate with zero mean and a standard deviation of stdDeviation the returned value is in the range +/- infinity (better: smallest, largest double number)

Method generates a gaussian distributed deviate with mean = 0 and the specified standard deviation borrowed from "Numerical Recipes in C++" by W.H. Press et al., Cambridge University Press

◆ rnd()

float Random::rnd ( )

Produces a random number between zero and one.

◆ uniformRandInRange()

float Random::uniformRandInRange ( float  a,
float  b 
)
inline

get a uniformly distributed random number in [a,b]


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