LevelS C++ support library  3.83
Public Member Functions | List of all members
planck_rng Class Reference

#include <planck_rng.h>

Public Member Functions

 planck_rng (unsigned int x1=123456789, unsigned int y1=362436069, unsigned int z1=521288629, unsigned int w1=88675123)
 
void seed (unsigned int x1=123456789, unsigned int y1=362436069, unsigned int z1=521288629, unsigned int w1=88675123)
 
unsigned int int_rand_uni ()
 
double rand_uni ()
 
double rand_gauss ()
 
double rand_exp ()
 

Detailed Description

C++ port of the xorshift generator xor128() described in Marsaglia, Journal of Statistical Software 2003, vol 8. It has a period of 2^128 - 1.

Definition at line 45 of file planck_rng.h.

Constructor & Destructor Documentation

◆ planck_rng()

planck_rng::planck_rng ( unsigned int  x1 = 123456789,
unsigned int  y1 = 362436069,
unsigned int  z1 = 521288629,
unsigned int  w1 = 88675123 
)
inline

Initializes the generator with 0 to 4 seed values.

Definition at line 80 of file planck_rng.h.

Member Function Documentation

◆ seed()

void planck_rng::seed ( unsigned int  x1 = 123456789,
unsigned int  y1 = 362436069,
unsigned int  z1 = 521288629,
unsigned int  w1 = 88675123 
)
inline

Re-initializes the generator with 0 to 4 seed values.

Definition at line 90 of file planck_rng.h.

◆ int_rand_uni()

unsigned int planck_rng::int_rand_uni ( )
inline

Returns uniformly distributed random integer numbers from the interval [0;0xFFFFFFFF].

Definition at line 100 of file planck_rng.h.

◆ rand_gauss()

double planck_rng::rand_gauss ( )
inline

Returns random numbers with Gaussian distribution (mean=0, sigma=1).

Uses rand_uni() internally.

Definition at line 118 of file planck_rng.h.

◆ rand_exp()

double planck_rng::rand_exp ( )
inline

Returns exponentially distributed random numbers (mean=1, nonnegative)

Uses rand_uni() internally.

Definition at line 145 of file planck_rng.h.


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

Generated on Wed Nov 13 2024 12:18:16 for LevelS C++ support library