ARTS
2.4.0(git:4fb77825)
|
#include <rng.h>
Public Member Functions | |
Rng () | |
Constructor creates instance of gsl_rng of type gsl_rng_mt19937. More... | |
~Rng () | |
Destructor frees memory allocated to gsl_rng. More... | |
void | seed (unsigned long int n, const Verbosity &verbosity) |
Seeds the Rng with the integer argument. More... | |
void | force_seed (unsigned long int n) |
Seeds the Rng with the integer argument. More... | |
double | draw () |
Draws a double from the uniform distribution [0,1) More... | |
unsigned long int | showseed () const |
Returns the seed number. More... | |
Private Attributes | |
gsl_rng * | r |
unsigned long int | seed_no |
Rng::Rng | ( | ) |
Constructor creates instance of gsl_rng of type gsl_rng_mt19937.
Definition at line 47 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.
double Rng::draw | ( | ) |
Draws a double from the uniform distribution [0,1)
Definition at line 97 of file rng.cc.
References gsl_rng_uniform(), and r.
Referenced by abs_lookupTestAccMC(), MCGeneral(), mcPathTraceRadar(), MCRadar(), ran_gaussian(), ran_uniform(), Sample_los(), and Sample_los_uniform().
void Rng::force_seed | ( | unsigned long int | n | ) |
void Rng::seed | ( | unsigned long int | n, |
const Verbosity & | verbosity | ||
) |
Seeds the Rng with the integer argument.
Every seed is only used once. The provided seed is increased by 1 until an unused seed is found.
The default is to seed the Rng using the seconds elapsed since 1970.
Definition at line 54 of file rng.cc.
References CREATE_OUT0, gsl_rng_set(), r, and seed_no.
Referenced by abs_lookupTestAccMC(), MCGeneral(), MCRadar(), and psd_cloudice_MH97().
unsigned long int Rng::showseed | ( | ) | const |
|
private |
|
private |
Definition at line 557 of file rng.h.
Referenced by force_seed(), seed(), and showseed().