GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
random-coll.c File Reference
#include "random-coll.h"
#include <math.h>

Go to the source code of this file.

Macros

#define _Cons   1
 
#define _Hi(X)
 
#define _Lo(X)
 
#define _Mask   0xFFFF
 
#define _Mult   1664525
 
#define BETA_TURNING_POINT   2
 
#define GAMMA_TURNING_POINT   7
 
#define GEOMETRIC_TURNING_POINT   0.38
 

Functions

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

Variables

static unsigned Scal =0xFFFFFFFF
 

Macro Definition Documentation

◆ _Cons

#define _Cons   1

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

Referenced by p_dUniform(), and p_iUniform().

◆ _Hi

#define _Hi ( X)
Value:
(((X)>>16)&_Mask) /* the 16 MSB of X (if 32 bit)*/
#define _Mask
Definition random-coll.c:92

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

Referenced by p_dUniform(), and p_iUniform().

◆ _Lo

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

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

Referenced by p_dUniform(), and p_iUniform().

◆ _Mask

#define _Mask   0xFFFF

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

◆ _Mult

#define _Mult   1664525

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

Referenced by p_dUniform(), and p_iUniform().

◆ BETA_TURNING_POINT

#define BETA_TURNING_POINT   2

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

Referenced by p_dBeta().

◆ GAMMA_TURNING_POINT

#define GAMMA_TURNING_POINT   7

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

Referenced by p_dGammaInt().

◆ GEOMETRIC_TURNING_POINT

#define GEOMETRIC_TURNING_POINT   0.38

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

Referenced by p_iGeometric().

Function Documentation

◆ p_dBeta()

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

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

References BETA_TURNING_POINT, p_dGammaGen(), and p_dUniform().

◆ p_dExponential()

double p_dExponential ( double lambda,
unsigned int * seed )

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

References p_dUniform().

Referenced by TGo4MbsRandom::rand_event().

◆ p_dGammaGen()

double p_dGammaGen ( double A,
unsigned * seed )

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

References p_dGammaInt(), and p_dUniform().

Referenced by p_dBeta().

◆ p_dGammaInt()

double p_dGammaInt ( int a,
unsigned int * seed )

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

References GAMMA_TURNING_POINT, and p_dUniform().

Referenced by p_dGammaGen().

◆ p_dNormal()

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

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

References p_dUniform().

Referenced by TGo4MbsRandom::rand_event().

◆ p_dUniform()

double p_dUniform ( unsigned * seed)

◆ p_iBinomial()

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

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

References p_dUniform().

◆ p_iGeometric()

int p_iGeometric ( double p,
unsigned int * seed )

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

References GEOMETRIC_TURNING_POINT, and p_dUniform().

◆ p_iPoisson()

int p_iPoisson ( double mu,
unsigned * seed )

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

References p_dUniform().

◆ p_iUniform()

unsigned p_iUniform ( unsigned * seed)

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

References _Cons, _Hi, _Lo, and _Mult.

Variable Documentation

◆ Scal

unsigned Scal =0xFFFFFFFF
static

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

Referenced by p_dUniform().