ARTS  2.2.66
Rng Class Reference

#include <rng.h>

Collaboration diagram for Rng:

Public Member Functions

 Rng ()
 
 ~Rng ()
 
void seed (unsigned long int n, const Verbosity &verbosity)
 
void force_seed (unsigned long int n)
 
double draw ()
 
unsigned long int showseed () const
 

Private Attributes

gsl_rngr
 
unsigned long int seed_no
 

Detailed Description

Definition at line 569 of file rng.h.

Constructor & Destructor Documentation

◆ Rng()

Rng::Rng ( )

Constructor creates instance of gsl_rng of type gsl_rng_mt19937

Definition at line 52 of file rng.cc.

References gsl_rng_alloc(), gsl_rng_mt19937, and r.

◆ ~Rng()

Rng::~Rng ( )

Destructor frees memory allocated to gsl_rng

Definition at line 61 of file rng.cc.

References gsl_rng_free(), and r.

Member Function Documentation

◆ draw()

double Rng::draw ( )

Draws a double from the uniform distribution [0,1)

Definition at line 120 of file rng.cc.

References gsl_rng_uniform(), and r.

Referenced by abs_lookupTestAccMC(), MCGeneral(), MCIPA(), mcPathTraceGeneral(), mcPathTraceIPA(), ran_gaussian(), and Sample_los().

◆ force_seed()

void Rng::force_seed ( unsigned long int  n)

Seeds the Rng with the integer argument.

Definition at line 110 of file rng.cc.

References gsl_rng_set(), r, and seed_no.

◆ seed()

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.

Definition at line 72 of file rng.cc.

References CREATE_OUT0, gsl_rng_set(), r, and seed_no.

Referenced by abs_lookupTestAccMC(), IWCtopnd_MH97(), mc_IWP_cloud_opt_pathCalc(), MCGeneral(), and MCIPA().

◆ showseed()

unsigned long int Rng::showseed ( ) const

Returns the seed number

Definition at line 129 of file rng.cc.

References seed_no.

Member Data Documentation

◆ r

gsl_rng* Rng::r
private

Definition at line 571 of file rng.h.

Referenced by draw(), force_seed(), gsl_rng_alloc(), gsl_rng_clone(), Rng(), seed(), and ~Rng().

◆ seed_no

unsigned long int Rng::seed_no
private

Definition at line 573 of file rng.h.

Referenced by force_seed(), seed(), and showseed().


The documentation for this class was generated from the following files: