Monte Carlo in GSL

linas@austin.ibm.com linas@austin.ibm.com
Wed Feb 18 18:13:00 GMT 2004


> 
> >My problem is: I want that the random numbers I generate are purelly
> >random and not that the series of the numbers repeats.
> >
> On a computer this is impossible but, you can use computer time function
> to inizialize every time with a different seed.
> 
> for example
> 
>  time_t T;
>  R = gsl_rng_alloc (gsl_rng_mt19937);
>  S = (unsigned) time(&T);
>  gsl_rng_set (R,S);

Umm,

Typically, you *want* to have random numbers that are 'deterministic'. 
That way, if your program does something strange and weird one day, 
you can repeat it again, and discover why it was weird.  If you
don't record the seed value, you will never be able to repeat 
the experiment again.

--linas



More information about the Gsl-discuss mailing list