[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] Random number generation

From: Carl Boettiger
Subject: Re: [Help-gsl] Random number generation
Date: Tue, 5 May 2009 10:46:56 -0700

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


On Tue, May 5, 2009 at 9:45 AM, Vibhuti Dave <address@hidden> 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
> address@hidden

Carl Boettiger
Population Biology, UC Davis

reply via email to

[Prev in Thread] Current Thread [Next in Thread]