rnga Class Reference

Random number generator base. More...

#include <rnga.h>

Inheritance diagram for rnga:

gsl_rnga

Detailed Description

Random number generator base.

Using virtual functions is not recommended for random number generators, as speed is often an important issue. In order to facilitate the use of templates for routines which require random number generators, all descendants ought to provides the following functions:

Idea for future:
Consider some analog of the GSL function gsl_rng_uniform_pos(), i.e. as used in the GSL Monte Carlo classes.

Definition at line 54 of file rnga.h.


Public Member Functions

void clock_seed ()
 Initialize the seed with a value taken from the computer clock.
unsigned long int get_seed ()
 Get the seed.
void set_seed (unsigned long int s)
 Set the seed.

Protected Member Functions

 rnga (const rnga &)
rngaoperator= (const rnga &)

Protected Attributes

unsigned long int seed
 The seed.

Member Function Documentation

void clock_seed (  ) 

Initialize the seed with a value taken from the computer clock.

This is a naive seed generator which uses seed=time(0) to generate a seed.

Idea for future:
Figure out a better way of computing a random seed in a platform-independent way.

Reimplemented in gsl_rnga.


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

Documentation generated with Doxygen and provided under the GNU Free Documentation License. See License Information for details.

Project hosting provided by SourceForge.net Logo, O2scl Sourceforge Project Page