> > class RandomNumberGenerator

> > {

> > public:

> > double GenerateUniform() { return gsl_rng_uniform (&Seed) };

>

> Would it be better to make this static as well? Then you wouldn't have

> to create objects of this class.

>

> > private:

> > static gsl_rng Seed;

> > };

>

> > gsl_rng RandomNumberGenerator::Seed = 0;
Do you see any evident problem in the the following solution?

class RandomNumber

{

private:

const gsl_rng_type* T;

gsl_rng* r;

public:

RandomNumber() ;

// Uniform random number generator.

double generateUniform();

// Distributions random number generators.

double generateGaussian(double mu, double sigma);

......

};

static RandomNumber randomNumber;

I would like to avoid passing r around because:

1) it's related to the use of the gsl library. And I would like to be

felixible about the library used for random number generation.

2) in stochastic simulations too many algorithms depend on the

generations of random numbers. I would really have to pass r even to

class constructors and so on.....

p.s. I know it is not a good name, r. It was just an example from the

gsl documentation

Thank you

StephQ