Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Protected Member Functions | Protected Attributes
rnga Class Reference

Random number generator base. More...

#include <rnga.h>

Inheritance diagram for rnga:
gsl_rnga

Detailed Description

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 52 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 rnga::clock_seed ( )

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:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.