#include <rng.h>
Public Member Functions | |
Rng () | |
~Rng () | |
void | seed (unsigned long int n) |
double | draw () |
unsigned long int | showseed () |
Private Attributes | |
gsl_rng * | r |
unsigned long int | seed_no |
Definition at line 567 of file rng.h.
Rng::Rng | ( | ) |
Constructor creates instance of gsl_rng of type gsl_rng_mt19937
Definition at line 43 of file rng.cc.
References gsl_rng_alloc(), gsl_rng_mt19937, and r.
Rng::~Rng | ( | ) |
Destructor frees memory allocated to gsl_rng
Definition at line 52 of file rng.cc.
References gsl_rng_free(), and r.
void Rng::seed | ( | unsigned long int | n | ) |
Seeds the Rng with the integer argument. If no argument is given the Rng is seeded using the system time (number of seconds since 1-1-1970)
Definition at line 61 of file rng.cc.
References gsl_rng_set(), r, and seed_no.
Referenced by mc_IWP_cloud_opt_pathCalc(), MCGeneral(), MCIPA(), and ScatteringMonteCarlo().
double Rng::draw | ( | ) |
Draws a double from the uniform distribution [0,1)
Definition at line 71 of file rng.cc.
References gsl_rng_uniform(), and r.
Referenced by MCGeneral(), MCIPA(), mcPathTrace(), mcPathTraceGeneral(), mcPathTraceIPA(), ran_gaussian(), Sample_los(), Sample_ppathlengthLOS(), and ScatteringMonteCarlo().
unsigned long int Rng::showseed | ( | ) |
Definition at line 569 of file rng.h.
Referenced by draw(), gsl_rng_alloc(), gsl_rng_clone(), Rng(), seed(), and ~Rng().
unsigned long int Rng::seed_no [private] |