This chapter describes functions for generating quasi-random sequences
in arbitrary dimensions. A quasi-random sequence progressively covers a
d-dimensional space with a set of points that are uniformly distributed.
Quasi-random sequences are also known as low-discrepancy sequences. The
quasi-random sequence generators use an interface that is similar to the
interface for random number generators.
The functions described in this section are declared in the header file
Function: gsl_qrng * gsl_qrng_alloc(const gsl_qrng_type * T, unsigned int d)
This function returns a pointer to a newly-created instance of a
quasi-random sequence generator of type T and dimension d.
If there is insufficient memory to create the generator then the
function returns a null pointer and the error handler is invoked with an
error code of GSL_ENOMEM.
Function: void gsl_qrng_free(gsl_qrng * q)
This function frees all the memory associated with the generator
Function: void gsl_qrng_init(gsl_qrng * q)
This function reinitializes the generator q to its starting point.
These function return a pointer to the state of generator r and
its size. You can use this information to access the state directly. For
example, the following code will write the state of a generator to a
void * state = gsl_qrng_state (q);
size_t n = gsl_qrng_size (q);
fwrite (state, n, 1, stream);
The implementations of the quasi-random sequence routines are based on
the algorithms described in the following paper,
P. Bratley and B.L. Fox and H. Niederreiter, "Algorithm 738: Programs
to Generate Niederreiter's Low-discrepancy Sequences", Transactions on
Mathematical Software, Vol. 20, No. 4, December, 1994, p. 494-495.