On 08/06/2014 02:08 AM, Anye Li wrote:
Hi,

Does anybody know of a way to seed the random number generator with an
array of data, so that the number of sequences available is limited by
the size of the state rather than the range of the RNG?  I see
gsl_rng_memcpy and gsl_rng_fread in the documentation but it seems these
are for restoring a known good state, not for seeding with unknown data.
I'm looking for something along the lines of MT19937's init_by_array.


I'm curious what your use case is when this is an actual limitation. FWIW, I reckon it's against the idea with gsl_rng as it was design to be polymorphic so one can easily replace one generator with another.

Anyway, AFAICS, you can seed set the state with something like

void set_state(gsl_rng* r, void* seed, size_t size)
{
    memcpy(r->state, seed, size);
}

cheers,

--
Peter Johansson


Reply via email to