Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

generators::DISCREP Class Reference

A random vector generator using discrepancy sampling. More...

#include <discrep.h>

Inheritance diagram for generators::DISCREP:

generators::RVG List of all members.

Public Member Functions

 DISCREP (unsigned int dim)
 Base constructor.
virtual ~DISCREP ()
 Base deconstructor.
virtual void nextVector (double *x)
 Generate d new coordinates (= 1 point).
virtual void setSeed (double *x, unsigned int s)
 Initialises the discrepancy sampler.

Protected Attributes

int pa [MAX_DIM][COORD_DIGITS]
 Coefficients a_{i,k} for each P_i^k.
double pip [MAX_DIM][COORD_DIGITS]
 Cache prime inverse powers: P_i^{-k-1}.

Static Protected Attributes

int primes [MAX_DIM] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131}
 A list of pre-defined prime numbers.

Detailed Description

A random vector generator using discrepancy sampling.

Discrepancy sampling uses prime base expansion of point indices to obtain properly distributed points in $[0,1]^d$.


Constructor & Destructor Documentation

generators::DISCREP::DISCREP unsigned int  dim  )  [inline]
 

Base constructor.

Simply calls RVG's constructor.

Parameters:
dim The dimension d of the space from which points are sampled.
See also:
RVG::RVG()


Member Function Documentation

void generators::DISCREP::nextVector double *  x  )  [virtual]
 

Generate d new coordinates (= 1 point).

Make sure to have called setSeed(double*, int) at least once before.

Parameters:
x The vector that should the new coordinates.

Implements generators::RVG.

void generators::DISCREP::setSeed double *  x,
unsigned int  s
[virtual]
 

Initialises the discrepancy sampler.

Since this sampler calculates points based on the previously generated point, x has to be supplied to the seeding function.

Note that the state of the RNG *partially* is stored in the vector x!

Parameters:
x The vector in which randomly generated vectors are stored.
s The seed to be used for initialising x.


The documentation for this class was generated from the following files:
Generated on Fri Sep 4 18:03:46 2009 for LabSci RNG/MC generators by  doxygen 1.3.9.1