Joe wrote: > I have a simple question. Do I need a seperate random number generator > instance for each distribution I use? E.g, I have two different > simulation > parameters, one exponential, the other poisson distributed. > > Basically, right now, my RNG is wrapped within a singleton class meaning > that I have only one instance, systemwide. Is this a good approach? It depends on what you are trying to do. If it did not, then GSL would not let you have two random number generators at the same time. However, for most applications, on gsl_rng is enough. If you just want uncorrelated random variates from a variety of different distributions, then one gsl_rng will do.
There are some dangers of using two. If (say) you use one gsl_rng for exponentials and one for uniform variates, use the same type of gsl_rng with the same seed, and call each generator equally often then while the sequence of exponential variates will show no little correlation and the sequence of uniform variates will show little correlation, but the sequences will be highly correlated with each other. This is usually undesirable. -- JDL _______________________________________________ Help-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gsl
