Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

TRNG Namespace Reference

Tina's random number generators namespace. More...


Compounds

struct  vector2d_struct
 two dimensional vector structure.

struct  vector3d_struct
 three dimensional vector structure.

struct  vector4d_struct
 four dimensional vector structure.

class  RNG
 pseudo random number generator template. More...

class  generic_MLCG
 linear congruential generator. More...

class  ParkMiller
 linear congruential generator. More...

class  LCG32
 linear congruential generator. More...

class  LCG64
 linear congruential generator. More...

class  MRG2
 multiple recursive generator. More...

class  MRG3
 multiple recursive generator. More...

class  MRG4
 multiple recursive generator. More...

class  YARNLCG64
 YARN -- a modified linear recursive generator. More...

class  YARN2
 YARN -- a modified multiple recursive generator. More...

class  YARN3
 YARN -- a modified multiple recursive generator. More...

class  YARN4
 YARN -- a modified multiple recursive generator. More...

class  CLCG2
 combined generator. More...

class  CLCG3
 combined generator. More...

class  CLCG4
 combined generator. More...

class  EINV
 explicit inversive congruential generator. More...

class  EINVLCG64
 combined generator. More...

class  trng_gsl
 wrapper class for GSL random number generators. More...

class  error
 class for error handling. More...

class  power
 power. More...


Typedefs

typedef vector2d_struct vector2d
 two dimensional vector. More...

typedef vector3d_struct vector3d
 three dimensional vector. More...

typedef vector4d_struct vector4d
 four dimensional vector. More...


Enumerations

enum  RNG_type {
  RNG_t, generic_MLCG_t, ParkMiller_t, LCG32_t, LCG64_t,
  MRG2_t, MRG3_t, MRG4_t, YARNLCG64_t, YARN2_t,
  YARN3_t, YARN4_t, CLCG2_t, CLCG3_t, CLCG4_t,
  EINV_t, EINVLCG64_t, trng_gsl_t, user1_t = 1001, user2_t = 1002,
  user3_t = 1003, user4_t = 1004, user5_t = 1005
}
 pseudo random number generator types. More...


Functions

const char * version (void)
 TRNG version. More...

long modulo_invers (long, long)
 modulo invers. More...

void gauss (std::vector< long > &, std::vector< long > &, long)
 linear system solver in modular arithmetic. More...

void matrix_mult (const std::vector< long > &, const std::vector< long > &, std::vector< long > &, long)
 matrix multiplication. More...

void matrix_vec_mult (const std::vector< long > &, const std::vector< long > &, std::vector< long > &, long)
 matrix vector multiplication. More...

double Gamma (double)
  -function. More...

double ln_Gamma (double)
  of -function. More...

double Gamma_P (double, double)
 incomplete -function. More...

double Gamma_Q (double, double)
 incomplete -function. More...

double incomp_Gamma (double, double)
 incomplete -function. More...

double comp_incomp_Gamma (double, double)
 incomplete -function. More...

double Gamma_ser (double, double)
 incomplete -function. More...

double Gamma_cf (double, double)
 incomplete -function. More...

double ln_factorial (long)
 logarithm of the factorial function. More...

long binomial_coeff (long, long)
 binomial coefficient. More...

double errf (double)
 error function. More...

double chi_square_test (const std::vector< double > &, const std::vector< double > &)
 Chisquare test. More...

double chi_square_prob (double, long)
 chisquare test. More...

double Stirling_num2 (long, long)
 Stirling number. More...

double Student_t (double, long, bool=true)
 values for Student's -distribution. More...

long find_interval (const std::vector< double > &, const double)
 find interval. More...

double uniform_pdf (double)
 probalility density. More...

double uniform_pdf (double, double, double)
 probalility density. More...

double uniformco_pdf (double)
 probalility density. More...

double uniformco_pdf (double, double, double)
 probalility density. More...

double uniformcc_pdf (double)
 probalility density. More...

double uniformcc_pdf (double, double, double)
 probalility density. More...

double uniformoc_pdf (double)
 probalility density. More...

double uniformoc_pdf (double, double, double)
 probalility density. More...

double uniformoo_pdf (double)
 probalility density. More...

double uniformoo_pdf (double, double, double)
 probalility density. More...

double normal_dist_pdf (double, double, double)
 probalility density. More...

double exp_dist_pdf (double, double)
 probalility density. More...

double laplace_dist_pdf (double, double)
 probalility density. More...

double tent_dist_pdf (double, double)
 probalility density. More...

double Gamma_dist_pdf (double, double, double)
 probalility density. More...

double Beta_dist_pdf (double, double, double)
 probalility density. More...

double chi_square_dist_pdf (double, double)
 probalility density. More...

double Student_t_dist_pdf (double, double)
 probalility density. More...

double binomial_dist_pdf (long, long, double)
 probalility density. More...

double poisson_dist_pdf (long, double)
 probalility density. More...

double geometric_dist_pdf (long, double)
 probalility density. More...


Detailed Description

All function and classes are encapsulated by the namespace TRNG.


Typedef Documentation

typedef struct vector2d_struct TRNG::vector2d
 

This structure is for storing two dimensional vectors. The method TRNG::RNG::spherical2d(void) returns this structure.

Definition at line 83 of file trng.h.

typedef struct vector3d_struct TRNG::vector3d
 

This structure is for storing three dimensional vectors. The method TRNG::RNG::spherical3d(void) returns this structure.

Definition at line 100 of file trng.h.

typedef struct vector4d_struct TRNG::vector4d
 

This structure is for storing four dimensional vectors. The method TRNG::RNG::spherical4d(void) returns this structure.

Definition at line 119 of file trng.h.


Enumeration Type Documentation

enum TRNG::RNG_type
 

Every pseudo random number generator's type can be identified by a class member type which has anny value from this enumeration type.

Enumeration values:
RNG_t  not specialized random number generator.
generic_MLCG_t  generic multiplicative linear congruential random number generator.
ParkMiller_t  random number generator class ParkMiller.
LCG32_t  random number generator class LCG32.
LCG64_t  random number generator class LCG64.
MRG2_t  random number generator class MRG2.
MRG3_t  random number generator class MRG3.
MRG4_t  random number generator class MRG4.
YARNLCG64_t  random number generator class YARNLCG64.
YARN2_t  random number generator class YARN2.
YARN3_t  random number generator class YARN3.
YARN4_t  random number generator class YARN4.
CLCG2_t  random number generator class CLCG2.
CLCG3_t  random number generator class CLCG3.
CLCG4_t  random number generator class CLCG4.
EINV_t  random number generator class EINV.
EINVLCG64_t  random number generator class EINVLCG64.
trng_gsl_t  random number generator class trng_gsl.
user1_t  user defined random number generator class nr 1.
user2_t  user defined random number generator class nr 2.
user3_t  user defined random number generator class nr 3.
user4_t  user defined random number generator class nr 4.
user5_t  user defined random number generator class nr 5.

Definition at line 44 of file trng.h.


Function Documentation

const char * TRNG::version void   
 

This function returns a pointer to a zero termiated string with the TRNG version.

Returns:
pointer to a zero termiated string

Definition at line 30 of file trnglib.cc.

long TRNG::modulo_invers long    a,
long    m
 

Solves the equation .

Returns:
the inverse of .
Parameters:
a  a positive integer.
m  a prime modulus.
Exceptions:
error  if or or no inversive exists
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 46 of file trnglib.cc.

Referenced by gauss().

void TRNG::gauss std::vector< long > &    a,
std::vector< long > &    b,
long    m
 

Solves a system of linear equations

in modular arithmetic using Gauß elimination.

Parameters:
a  reference to the coefficient matrix, content is destroyed after function call
b  reference to the inhomogenous right side, contains the solution after function call
m  prime modulus
Exceptions:
error  if coefficient matrix is singular or the matrices have invalid sizes
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 94 of file trnglib.cc.

References modulo_invers().

void TRNG::matrix_mult const std::vector< long > &    a,
const std::vector< long > &    b,
std::vector< long > &    c,
long    m
 

Multiply two equal sized quadratic matrices and in modular arithmetic, .

Parameters:
a  reference to matrix
b  reference to matrix
c  reference to matrix
m  modulus
Exceptions:
error  if the matrices are different sized
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 183 of file trnglib.cc.

void TRNG::matrix_vec_mult const std::vector< long > &    a,
const std::vector< long > &    b,
std::vector< long > &    c,
long    m
 

Multiply a quadratic matrix and $a$ vector in modular arithmetic, .

Parameters:
a  reference to matrix
b  reference to vector
c  reference to vector
m  modulus
Exceptions:
error  if the matrices are different sized
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 217 of file trnglib.cc.

double TRNG::Gamma double    x
 

Computes the -function for positive arguments.

Parameters:
x  argument
Exceptions:
error  if
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 291 of file trnglib.cc.

double TRNG::ln_Gamma double    x
 

Computes the -function's logarithm for positive arguments.

Parameters:
x  argument
Exceptions:
error  if
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 254 of file trnglib.cc.

double TRNG::Gamma_P double    a,
double    x
 

Computes the incomplete -function for positive arguments.

Parameters:
a  argument
x  argument
Exceptions:
error  if or
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 353 of file trnglib.cc.

double TRNG::Gamma_Q double    a,
double    x
 

Computes the incomplete -function for positive arguments.

Parameters:
a  argument
x  argument
Exceptions:
error  if or
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 377 of file trnglib.cc.

double TRNG::incomp_Gamma double    a,
double    x
 

Computes the incomplete -function for positive arguments.

Parameters:
a  argument
x  argument
Exceptions:
error  if or
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 401 of file trnglib.cc.

double TRNG::comp_incomp_Gamma double    a,
double    x
 

Computes the complementary incomplete -function for positive arguments.

Parameters:
a  argument
x  argument
Exceptions:
error  if or
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 423 of file trnglib.cc.

double TRNG::Gamma_ser double    a,
double    x
 

Computes incomplete Gamma function's ( ) power series representation for .

Parameters:
a  argument
x  argument
Exceptions:
error  if or or at convergence problems
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 444 of file trnglib.cc.

double TRNG::Gamma_cf double    a,
double    x
 

Computes incomplete Gamma function's ( ) continued fraction representation for .

Parameters:
a  argument
x  argument
Exceptions:
error  if or or at convergence problems
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 482 of file trnglib.cc.

double TRNG::ln_factorial long    n
 

Returns:
Parameters:
n 
Exceptions:
error  if
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 529 of file trnglib.cc.

long TRNG::binomial_coeff long    n,
long    k
 

Returns:
binomial coefficient or or is returned
Parameters:
n 
k 
Author:
Heiko Bauke

Definition at line 555 of file trnglib.cc.

double TRNG::errf double    x
 

Computes the error function

Returns:
Author:
Heiko Bauke

Definition at line 575 of file trnglib.cc.

double TRNG::chi_square_test const std::vector< double > &    prob,
const std::vector< double > &    observ
 

Applies a -test.

Returns:
-value
Parameters:
prob  reference to a vector with some probabilities
observ  reference to a vector with numbers of actual observations
Exceptions:
error  if arguments are not equal sized or number of observations is less then five
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 594 of file trnglib.cc.

double TRNG::chi_square_prob double    chi2,
long    df
 

Computes the probability corresponding to a -value.

Parameters:
chi2  -value
df  degrees of freedom
Exceptions:
error  if degrees of freedom less than one
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 626 of file trnglib.cc.

double TRNG::Stirling_num2 long    n,
long    m
 

Computes the Stirling number of the 2nd kind .

Returns:
Stirling number of the 2nd kind
Parameters:
n  1st parameter
m  2nd parameter
Author:
Heiko Bauke

Definition at line 651 of file trnglib.cc.

double TRNG::Student_t double    p,
long    nu,
bool    symmetric = true
 

Computes of the -distribution. is defined in the symmetric case as

and in the asymmetric case as

Parameters:
p  probability
nu  degrees of freedom
symmetric  is true for the symmetric case
Exceptions:
error  if less than one degree of freedom or probability out of range
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 691 of file trnglib.cc.

long TRNG::find_interval const std::vector< double > &    borders,
const    double
 

This function searches for the interval which contains using an algorithm. The intervals are

if is a sorted vector with elements with .

Returns:
interval number
Parameters:
borders  reference to a sorted vector with interval edges
x  value that determs the interval
Author:
Heiko Bauke

Definition at line 762 of file trnglib.cc.

Referenced by TRNG::RNG< LCG32 >::binomial_dist_tab().

double TRNG::uniform_pdf double    x
 

Calculates the probalility density function for in equidistributed random variate.

Returns:
if else
Author:
Heiko Bauke

Definition at line 789 of file trnglib.cc.

References uniformco_pdf().

double TRNG::uniform_pdf double    x,
double    a,
double    b
 

Calculates the probalility density function for in equidistributed random variate.

Returns:
if else
Author:
Heiko Bauke

Definition at line 800 of file trnglib.cc.

References uniformco_pdf().

double TRNG::uniformco_pdf double    x
 

Calculates the probalility density function for in equidistributed random variate.

Returns:
if else
Author:
Heiko Bauke

Definition at line 813 of file trnglib.cc.

Referenced by uniform_pdf().

double TRNG::uniformco_pdf double    x,
double    a,
double    b
 

Calculates the probalility density function for in equidistributed random variate.

Returns:
if else
Author:
Heiko Bauke

Definition at line 827 of file trnglib.cc.

double TRNG::uniformcc_pdf double    x
 

Calculates the probalility density function for in equidistributed random variate.

Returns:
if else
Author:
Heiko Bauke

Definition at line 843 of file trnglib.cc.

double TRNG::uniformcc_pdf double    x,
double    a,
double    b
 

Calculates the probalility density function for in equidistributed random variate.

Returns:
if else
Author:
Heiko Bauke

Definition at line 858 of file trnglib.cc.

double TRNG::uniformoc_pdf double    x
 

Calculates the probalility density function for in equidistributed random variate.

Returns:
if else
Author:
Heiko Bauke

Definition at line 874 of file trnglib.cc.

double TRNG::uniformoc_pdf double    x,
double    a,
double    b
 

Calculates the probalility density function for in equidistributed random variate.

Returns:
if else
Author:
Heiko Bauke

Definition at line 888 of file trnglib.cc.

double TRNG::uniformoo_pdf double    x
 

Calculates the probalility density function for in equidistributed random variate.

Returns:
if else
Author:
Heiko Bauke

Definition at line 904 of file trnglib.cc.

double TRNG::uniformoo_pdf double    x,
double    a,
double    b
 

Calculates the probalility density function for in equidistributed random variate.

Returns:
Author:
Heiko Bauke

Definition at line 918 of file trnglib.cc.

double TRNG::normal_dist_pdf double    x,
double    sigma = 1.0,
double    mu = 0.0
 

This function calculates the probalility density for a random variate with normal distribution. This distribution is defined as

with mean .

Returns:
Parameters:
x 
sigma  variance
mu  mean
Exceptions:
error  if
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 943 of file trnglib.cc.

double TRNG::exp_dist_pdf double    x,
double    mu = 1.0
 

This function calculates the probalility density for a random variate with exponential distribution. This distribution is defined as

with .

Returns:
Parameters:
x 
mu  mean ,
Exceptions:
error  if
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 971 of file trnglib.cc.

double TRNG::laplace_dist_pdf double    x,
double    a = 1.0
 

This function calculates the probalility density for a random variate with Laplace distribution. This distribution is defined as

with .

Returns:
Parameters:
x 
a  parameter ,
Exceptions:
error  if
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 997 of file trnglib.cc.

double TRNG::tent_dist_pdf double    x,
double    a = 1.0
 

The tent shaped probability distribution is defined as

with .

Returns:
Parameters:
x 
a  parameter
Exceptions:
error  if
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 1024 of file trnglib.cc.

double TRNG::Gamma_dist_pdf double    x,
double    a,
double    b
 

This function calculates the probalility density for a random variate with -distribution. This distribution is defined as

Returns:
Parameters:
x 
a  parameter ,
b  parameter ,
Exceptions:
error  if or
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 1055 of file trnglib.cc.

double TRNG::Beta_dist_pdf double    x,
double    a,
double    b
 

This function calculates the probalility density for a random variate with B-distribution. This distribution is defined as

Returns:
Parameters:
x 
a  parameter ,
b  parameter ,
Exceptions:
error  if or
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 1092 of file trnglib.cc.

double TRNG::chi_square_dist_pdf double    x,
double    nu
 

This function calculates the probalility density for a random variate with -distribution. This distribution is defined as

Returns:
Parameters:
x 
nu  parameter ,
Exceptions:
error  if
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 1124 of file trnglib.cc.

double TRNG::Student_t_dist_pdf double    x,
double    nu
 

This function calculates the probalility density for a random variate with Student's distribution. This distribution is defined as

Returns:
Parameters:
x 
nu  parameter ,
Exceptions:
error  if
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 1151 of file trnglib.cc.

double TRNG::binomial_dist_pdf long    k,
long    n,
double    p = 0.5
 

This function calculates the probalility density for a random variate with binomial distribution. This distribution is defined as

Returns:
Parameters:
k  parameter
n  number of trails
p  probability in each trail
Exceptions:
error  if or or
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 1177 of file trnglib.cc.

double TRNG::poisson_dist_pdf long    k,
double    mu
 

This function calculates the probalility density for a random variate with poisson distribution. This distribution is defined as

with mean .

Returns:
Parameters:
k  parameter
mu  mean
Author:
Heiko Bauke

Definition at line 1208 of file trnglib.cc.

double TRNG::geometric_dist_pdf long    k,
double    q
 

This function calculates the probalility density for a random variate with geometric distribution. This distribution is defined as

Returns:
Parameters:
q  probability
k  parameter
Exceptions:
error  if or or
See also:
TRNG::error
Author:
Heiko Bauke

Definition at line 1231 of file trnglib.cc.


Generated on Wed Feb 19 02:00:03 2003 for Tina's Random Number Generators by doxygen1.2.15