All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Private Member Functions
o2scl::rng_gsl Class Reference

Random number generator (GSL) More...

Detailed Description

If seed is zero, or is not given, then the default seed specific to the particular random number generator is used.

An interesting application of this class to generate an arbitrary distribution through a Markov chain Monte Carlo method is in Generate an arbitrary distribution.

Definition at line 51 of file rng_gsl.h.

#include <rng_gsl.h>

Public Member Functions

 rng_gsl (const gsl_rng_type *gtype=gsl_rng_mt19937)
 Initialize the random number generator with type gtype and the default seed.
 
 rng_gsl (double ig1, double ig2)
 
 rng_gsl (unsigned long int seed, const gsl_rng_type *gtype=gsl_rng_mt19937)
 Initialize the random number generator with seed.
 
const gsl_rng_type * get_type ()
 Return generator type.
 
double operator() (int ignored)
 Return a random number in $(0,1]$.
 
double random ()
 Return a random number in $(0,1]$.
 
unsigned long int get_max ()
 Return the maximum integer for random_int()
 
unsigned long int random_int (unsigned long int n=0)
 Return random integer in $[0,\mathrm{max}-1]$.
 
void set_seed (unsigned long int s)
 Set the seed.
 
void clock_seed ()
 Set the seed.
 

Protected Attributes

unsigned long int seed
 The seed.
 
gsl_rng * gr
 The GSL random number generator.
 
const gsl_rng_type * rng
 The GSL random number generator type.
 

Private Member Functions

 rng_gsl (const rng_gsl &)
 
rng_gsloperator= (const rng_gsl &)
 

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

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).
Hosted at Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads..