GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Macros | Functions | Variables
random-coll.c File Reference
#include "random-coll.h"
#include <math.h>

Go to the source code of this file.

Macros

#define BETA_TURNING_POINT   2
 
#define _Mult   1664525
 
#define _Cons   1
 
#define _Mask   0xFFFF
 
#define _Lo(X)   (X&_Mask) /* the 16 LSB of X */
 
#define _Hi(X)   ((X>>16)&_Mask) /* the 16 MSB of X (if 32 bit)*/
 
#define GAMMA_TURNING_POINT   7
 
#define GEOMETRIC_TURNING_POINT   0.38
 

Functions

unsigned p_iUniform (unsigned *seed)
 
double p_dUniform (unsigned *seed)
 
double p_dBeta (double a, double b, unsigned int *seed)
 
int p_iBinomial (double p, int n, unsigned int *seed)
 
double p_dExponential (double lambda, unsigned int *seed)
 
double p_dGammaInt (int a, unsigned int *seed)
 
double p_dGammaGen (double A, unsigned *seed)
 
int p_iGeometric (double p, unsigned int *seed)
 
double p_dNormal (double mean, double sigma, unsigned int *seed)
 
int p_iPoisson (double mu, unsigned *seed)
 

Variables

static unsigned Scal =0xFFFFFFFF
 

Macro Definition Documentation

#define _Cons   1

Definition at line 91 of file random-coll.c.

Referenced by p_dUniform(), and p_iUniform().

#define _Hi (   X)    ((X>>16)&_Mask) /* the 16 MSB of X (if 32 bit)*/

Definition at line 94 of file random-coll.c.

Referenced by p_dUniform(), and p_iUniform().

#define _Lo (   X)    (X&_Mask) /* the 16 LSB of X */

Definition at line 93 of file random-coll.c.

Referenced by p_dUniform(), and p_iUniform().

#define _Mask   0xFFFF

Definition at line 92 of file random-coll.c.

#define _Mult   1664525

Definition at line 90 of file random-coll.c.

Referenced by p_dUniform(), and p_iUniform().

#define BETA_TURNING_POINT   2

Definition at line 88 of file random-coll.c.

Referenced by p_dBeta().

#define GAMMA_TURNING_POINT   7

Definition at line 274 of file random-coll.c.

Referenced by p_dGammaInt().

#define GEOMETRIC_TURNING_POINT   0.38

Definition at line 397 of file random-coll.c.

Referenced by p_iGeometric().

Function Documentation

double p_dBeta ( double  a,
double  b,
unsigned int *  seed 
)

Definition at line 141 of file random-coll.c.

References go4init::a, BETA_TURNING_POINT, p_dGammaGen(), and p_dUniform().

double p_dExponential ( double  lambda,
unsigned int *  seed 
)

Definition at line 234 of file random-coll.c.

References p_dUniform().

Referenced by TGo4MbsRandom::rand_event().

double p_dGammaGen ( double  A,
unsigned *  seed 
)

Definition at line 316 of file random-coll.c.

References go4init::a, p_dGammaInt(), and p_dUniform().

Referenced by p_dBeta().

double p_dGammaInt ( int  a,
unsigned int *  seed 
)

Definition at line 276 of file random-coll.c.

References GAMMA_TURNING_POINT, and p_dUniform().

Referenced by p_dGammaGen().

double p_dNormal ( double  mean,
double  sigma,
unsigned int *  seed 
)

Definition at line 429 of file random-coll.c.

References p_dUniform().

Referenced by TGo4MbsRandom::rand_event().

double p_dUniform ( unsigned *  seed)
int p_iBinomial ( double  p,
int  n,
unsigned int *  seed 
)

Definition at line 196 of file random-coll.c.

References p_dUniform().

int p_iGeometric ( double  p,
unsigned int *  seed 
)

Definition at line 399 of file random-coll.c.

References GEOMETRIC_TURNING_POINT, and p_dUniform().

int p_iPoisson ( double  mu,
unsigned *  seed 
)

Definition at line 460 of file random-coll.c.

References p_dUniform().

unsigned p_iUniform ( unsigned *  seed)

Definition at line 113 of file random-coll.c.

References _Cons, _Hi, _Lo, and _Mult.

Variable Documentation

unsigned Scal =0xFFFFFFFF
static

Definition at line 125 of file random-coll.c.

Referenced by p_dUniform().