NEST  2.6.0,not_revisioned_source_dir@0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
librandom::GslRandomGen Class Reference

class GslRandomGen C++ wrapper for GSL/GSL-style generators. More...

#include <gslrandomgen.h>

Inheritance diagram for librandom::GslRandomGen:
librandom::RandomGen librandom::RandomGen

Public Member Functions

 GslRandomGen (const gsl_rng_type *, unsigned long)
 
 ~GslRandomGen ()
 
RngPtr clone (unsigned long s)
 clone a random number generator of same type initialized with given seed More...
 
- Public Member Functions inherited from librandom::RandomGen
 RandomGen ()
 
virtual ~RandomGen ()
 
double drand (void)
 The following functions implement the user interface of the RandomGen class, including buffer management. More...
 
double operator() (void)
 draw from [0, 1) More...
 
double drandpos (void)
 draw from (0, 1) More...
 
unsigned long ulrand (const unsigned long)
 draw from [0, n-1] More...
 
void seed (const unsigned long)
 set random seed to a new value More...
 
size_t get_buffsize (void) const
 returns buffer size More...
 
void set_buffsize (const size_t)
 set buffer size More...
 

Static Public Member Functions

static void add_gsl_rngs (Dictionary &)
 Add all GSL RNGs to rngdict. More...
 
static void add_gsl_rngs (Dictionary &)
 Add all GSL RNGs to rngdict Do nothing if GSL not available. More...
 
- Static Public Member Functions inherited from librandom::RandomGen
static RngPtr create_knuthlfg_rng (unsigned long)
 Create built-in Knuth Lagged Fibonacci random generator. More...
 

Private Member Functions

void seed_ (unsigned long)
 The following functions provide the interface to the actual random generator. More...
 
double drand_ (void)
 drawing interface More...
 
 GslRandomGen ()
 
 ~GslRandomGen ()
 

Private Attributes

gsl_rng_type const * rng_type_
 
gsl_rng * rng_
 

Friends

class GSL_BinomialRandomDev
 

Additional Inherited Members

- Static Public Attributes inherited from librandom::RandomGen
static const unsigned long DefaultSeed = 0xd37ca59fUL
 Default value for seeding generators in places where no seed is supplied. More...
 

Detailed Description

class GslRandomGen C++ wrapper for GSL/GSL-style generators.

Note
This class should only be used within librandom.

Constructor & Destructor Documentation

librandom::GslRandomGen::GslRandomGen ( const gsl_rng_type *  type,
unsigned long  seed 
)
explicit
Parameters
typegiven RNG, given seed

References assert(), rng_, and rng_type_.

librandom::GslRandomGen::~GslRandomGen ( )
librandom::GslRandomGen::GslRandomGen ( )
inlineprivate

References assert().

Referenced by clone().

librandom::GslRandomGen::~GslRandomGen ( )
inlineprivate

References assert().

Member Function Documentation

void librandom::GslRandomGen::add_gsl_rngs ( Dictionary rngdict)
static

Add all GSL RNGs to rngdict.

References assert(), Dictionary::insert_move(), and Dictionary::known().

Referenced by RandomNumbers::init(), and main().

static void librandom::GslRandomGen::add_gsl_rngs ( Dictionary )
inlinestatic

Add all GSL RNGs to rngdict Do nothing if GSL not available.

RngPtr librandom::GslRandomGen::clone ( unsigned long  long)
inlinevirtual

clone a random number generator of same type initialized with given seed

Implements librandom::RandomGen.

References GslRandomGen(), and rng_type_.

double librandom::GslRandomGen::drand_ ( void  )
inlineprivatevirtual

drawing interface

Implements librandom::RandomGen.

References rng_.

void librandom::GslRandomGen::seed_ ( unsigned  long)
inlineprivatevirtual

The following functions provide the interface to the actual random generator.

They must be implemented by each derived generator class.seeding interface

Implements librandom::RandomGen.

References rng_.

Friends And Related Function Documentation

friend class GSL_BinomialRandomDev
friend

Member Data Documentation

gsl_rng* librandom::GslRandomGen::rng_
private
gsl_rng_type const* librandom::GslRandomGen::rng_type_
private

Referenced by clone(), and GslRandomGen().


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