Relacs
0.9.8
|
#include <random.h>
Public Member Functions | |
RandomGSL (const gsl_rng_type *rt=gsl_rng_mt19937) | |
RandomGSL (unsigned long seed, const gsl_rng_type *rt=gsl_rng_mt19937) | |
virtual | ~RandomGSL (void) |
virtual unsigned long | setSeed (unsigned long seed) |
virtual unsigned long | integer (void) |
unsigned long | integer (unsigned long int max) |
virtual unsigned long | min (void) const |
virtual unsigned long | max (void) const |
unsigned long | operator() (unsigned long n) |
double | operator() (void) |
virtual double | uniform (void) |
double | positive (void) |
virtual double | gaussian (void) |
double | gaussian (double sigma) |
virtual double | exponential (void) |
double | exponential (double mu) |
virtual double | gamma (double a) |
double | gamma (double a, double b) |
double | lognormal (double zeta, double sigma) |
double | chisq (double nu) |
double | fdist (double nu1, double nu2) |
double | tdist (double nu) |
unsigned int | poisson (double mu) |
int | binomial (double p, int n) |
virtual string | name (void) |
Public Member Functions inherited from RandomBase | |
RandomBase (void) | |
RandomBase (unsigned long seed) | |
virtual | ~RandomBase (void) |
unsigned long | operator() (unsigned long n) |
double | operator() (void) |
virtual double | gamma (int a) |
Protected Attributes | |
gsl_rng * | Rng |
An implementation of RandomBase for the random number generators from the GSL library.
RandomGSL | ( | const gsl_rng_type * | rt = gsl_rng_mt19937 | ) |
Construct the random number generator. There are many different random number generators available that can be passed to this class: gsl_rng_mt19937, gsl_gsl_rng_ranlxs0, gsl_rng_ranlxs1, rng_ranlxs2, gsl_rng_ranlxd1, gsl_rng_ranlxd2, gsl_rng_ranlux, gsl_rng_ranlux389, gsl_rng_cmrg, gsl_rng_mrg, gsl_rng_taus, gsl_rng_taus2, gsl_rng_gfsr4, gsl_rng_rand, gsl_rng_random_bsd, gsl_rng_random_libc5, gsl_rng_random_glibc2, gsl_rng_rand48, gsl_rng_ranf, gsl_rng_ranmar, gsl_rng_r250, gsl_rng_tt800, gsl_rng_vax, gsl_rng_transputer, gsl_rng_randu, gsl_rng_minstd, gsl_rng_uni, gsl_rng_uni32, gsl_rng_slatec, gsl_rng_zuf, gsl_rng_borosh13, gsl_rng_coveyou, gsl_rng_fishman18, gsl_rng_fishman20, gsl_rng_fishman2x, gsl_rng_knuthran2, gsl_rng_knuthran, gsl_rng_lecuyer21, gsl_rng_waterman14. See the GSL documentation for details.
References RandomGSL::Rng, and RandomGSL::setSeed().
RandomGSL | ( | unsigned long | seed, |
const gsl_rng_type * | rt = gsl_rng_mt19937 |
||
) |
This constructor creates a random number generator with a specified seed.
References RandomGSL::Rng, and RandomGSL::setSeed().
|
virtual |
References RandomGSL::Rng.
|
virtual |
Set the seed of the random number generator to seed. If seed is 0, then the system time is used to generate a seed to imitate real randomness. Returns the seed.
Implements RandomBase.
References RandomGSL::Rng.
Referenced by OutData::bandNoiseWave(), OutData::noiseWave(), OutData::ouNoiseWave(), and RandomGSL::RandomGSL().
|
virtual |
Returns a uniformly distributed random integer between min() and max().
Implements RandomBase.
References RandomGSL::Rng.
|
inline |
Returns a uniformly distributed random integer between 0 and max exclusively. This function is NOT virtual in order to speed up computation.
|
virtual |
|
virtual |
|
inline |
Returns an uniformly distributed integer random number between zero and n. The range includes 0 but excludes n. This operator conforms to the STL RandomNumberGenerator specification. This function is NOT virtual in order to speed up computation.
|
inline |
Returns a uniformly distributed random number between zero and one. The range includes 0.0 but excludes 1.0. This operator is NOT virtual in order to speed up computation.
|
virtual |
Returns a uniformly distributed random number between zero and one. The range includes 0.0 but excludes 1.0.
Implements RandomBase.
References RandomGSL::Rng.
|
inline |
Returns a uniformly distributed random number between zero and one. The range excludes both 0.0 and 1.0 This function is NOT virtual in order to speed up computation.
|
virtual |
Returns a unit gaussian distributed random number.
Implements RandomBase.
References RandomGSL::Rng.
|
inline |
Returns a gaussian distributed random number with standard deviation sigma.
|
virtual |
Returns an exponential distributed random number with mean one.
Reimplemented from RandomBase.
References RandomGSL::Rng.
|
inline |
Returns an exponential distributed random number with mean mu.
|
virtual |
Returns a gamma distributed random number p(x) dx = x^(a-1) exp(-x)/Gamma(a) dx.
References RandomGSL::Rng.
|
inline |
Returns a gamma distributed random number p(x) dx = x^(a-1) exp(-x/b)/Gamma(a) b^a dx.
|
inline |
Returns a lognormal distributed random number p(x) dx = (1 / x sqrt(2 pi sigma^2)) exp(-(ln(x) - zeta)^2/2 sigma^2) dx.
|
inline |
Returns a Chi-squared distributed random number p(x) dx = (1 / Gamma(nu/2)) (x/2)^(nu/2 - 1) exp(-x/2) dx
|
inline |
Returns a F distributed random number.
|
inline |
Returns a t distributed random number.
|
inline |
Returns a Poisson distributed random number. p(k) = (mu^k / k!) exp(-mu)
|
inline |
Returns a Binomial distributed random number. p(k) = (n! / k! (n-k)!) p^k (1-p)^(n-k)
|
virtual |
|
protected |