libfbm  0.3
Simulation of multi-dimensional stationary Gaussian processes and fractional Brownian motion.
 All Classes Namespaces Functions Variables Friends
Public Member Functions
libfbm::Seeder Class Reference

Seed generator for random number generators. More...

#include <libfbm.hpp>

List of all members.

Public Member Functions

 Seeder (const char *path)
 Construct the Seeder.
 ~Seeder ()
void seed (uint32_t index)
size_t size () const
 operator const unsigned char * () const

Detailed Description

Seed generator for random number generators.

The Mersenne twister has a known weakness, that is with a small integer seed the first generated values are not very random. That is it takes a while for the generator to "work in". To get over this one can use a larger seed. This class generates such seeds from an integer index and a datafile containing random bits. On Unix one can easily generate such a seed pool file by executing:

dd if=/dev/urandom of=seedpool.dat bs=1024 count=1024

The seeds generated are 256 bytes long and contain blocks from the seed pool xor-ed with the given index. I'm not a specialist in random number generation, so I hope this is adequate.

Definition at line 388 of file libfbm.hpp.


Constructor & Destructor Documentation

libfbm::Seeder::Seeder ( const char *  path)

Construct the Seeder.

The program aborts if the path cannot be opened or seed pool is too small (4kB).

libfbm::Seeder::~Seeder ( )

Member Function Documentation

libfbm::Seeder::operator const unsigned char * ( ) const
inline

Definition at line 399 of file libfbm.hpp.

void libfbm::Seeder::seed ( uint32_t  index)
size_t libfbm::Seeder::size ( ) const
inline

Definition at line 398 of file libfbm.hpp.


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