You can also use /dev/random.

----- Original Message -----
From: [email protected] 
<[email protected]>
To: Vibhuti Dave <[email protected]>
Cc: [email protected] <[email protected]>
Sent: Tue May 05 12:46:56 2009
Subject: Re: [Help-gsl] Random number generation

You can set the seed gsl_rng_set.  A common method I believe is to set
the seed based on the timestamp, so the code runs with a different
seed each time.  Thoughts?
i.e. try:
        gsl_rng_set(r, time(NULL));
note: you'll need to include time.h

-Carl

On Tue, May 5, 2009 at 9:45 AM, Vibhuti Dave <[email protected]> wrote:
> Hi,
> I am trying to generate a random sequence of numbers that have a Gaussian
> distribution with mean 0 and standard deviation of 1.
> My code is attached. It is a simple code since I am beginner at programming
> and also using the GSL library for the first time. I need to run this code a
> 1000 times. Each time, i want the code to generate 600 random numbers with a
> Gaussian distribution as specified above. My question is, is there a way to
> change the seed for the random function generator besides changing it at
> command line. I cant run the code manually a 1000 times to make sure that i
> get to change the seed.
> Any help would be appreciated, thanks
> Vibhuti
>
> _______________________________________________
> Help-gsl mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/help-gsl
>
>



-- 
Carl Boettiger
Population Biology, UC Davis
http://two.ucdavis.edu/~cboettig


_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to