Node:Copying random number generator state, Next:, Previous:Random number environment variables, Up:Random Number Generation

Copying random number generator state

The above methods do not expose the random number `state' which changes from call to call. It is often useful to be able to save and restore the state. To permit these practices, a few somewhat more advanced functions are supplied. These include:

int gsl_rng_memcpy (gsl_rng * dest, const gsl_rng * src) Function
This function copies the random number generator src into the pre-existing generator dest, making dest into an exact copy of src. The two generators must be of the same type.

gsl_rng * gsl_rng_clone (const gsl_rng * r) Function
This function returns a pointer to a newly created generator which is an exact copy of the generator r.