Go to the documentation of this file.
12 #include <gsl/gsl_errno.h>
13 #include <gsl/gsl_rng.h>
14 #include <gsl/gsl_randist.h>
23 #define PMC_RAND_GSL_SUCCESS 0
26 #define PMC_RAND_GSL_INIT_FAIL 1
30 #define PMC_RAND_GSL_NOT_INIT 2
34 #define PMC_RAND_GSL_ALREADY_INIT 3
50 gsl_set_error_handler_off();
#define PMC_RAND_GSL_INIT_FAIL
Result code indicating initialization failure.
int pmc_srand_gsl(int seed)
Initialize the random number generator with the given seed.
static gsl_rng * pmc_rand_gsl_rng
Private internal-use variable to store the random number generator.
int pmc_rand_poisson_gsl(double mean, int *harvest)
Generate a Poisson-distributed random integer.
int pmc_rand_finalize_gsl()
Cleanup and deallocate the random number generator.
int pmc_rand_int_gsl(int n, int *harvest)
Generate a uniform random integer in .
int pmc_rand_gsl(double *harvest)
Generate a uniform random number in .
#define PMC_RAND_GSL_SUCCESS
Result code indicating successful completion.
#define PMC_RAND_GSL_NOT_INIT
Result code indicating the generator was not initialized when it should have been.
int pmc_rand_binomial_gsl(int n, double p, int *harvest)
Generate a Binomial-distributed random integer.
int pmc_rand_normal_gsl(double mean, double stddev, double *harvest)
Generate a normally-distributed random number.
#define PMC_RAND_GSL_ALREADY_INIT
Result code indicating the generator was already initialized when an initialization was attempted.