views:

152

answers:

6

Hi,

I'm looking for known libraries that are able to generate non uniformly distributed random numbers for C, C++ and Java.

Thanks

+5  A: 

I got some interesting responses in this related question:

http://stackoverflow.com/questions/1396978/biased-random-number-sources

uosɐſ
+3  A: 

For Java, one option is my Uncommons Maths library. It supports Uniform, Gaussian, Binomial, Poisson and Exponential distributions. There is a WebStart demo so you can see what it does.

Dan Dyer
+2  A: 

Have a look at Alglib's implementations, they have a few basic distributions implemented in several languages.

Jonatan Lindén
This link leads algorithms for the calculation of several distribution functions, but I didn't find any algorithms for the calculation of random numbers drawn from the distributions.
M. S. B.
Yes, that's true, you have to use a separate RNG. For example invpoissondistribution(k, rng.nextDouble()) would give you a Poisson variate with parameter k.
Jonatan Lindén
A: 

Numerical Recipes discusses a few algorithms for random number generators.

Parappa
Actually i already wrote some algorithms for random number generators: Box-Muller, Rejection method among others.. So i'm just looking for libraries that has the reputation to generate strong random numbers non uniformly distributed
Amokrane
+1  A: 

Boost has a fairly wide selection of random number generates, plus the ability to filter these through several distributions.

Russell Newquist
+2  A: 

The GNU Scientific Library (GSL), http://www.gnu.org/software/gsl/, provides numerous non-uniform random distributions -- see Chapter 19 of the Manual, "Random Number Distributions". (Uniform random number generators are in Chapter 17, "Random Number Generation"). The implementation is in C.

M. S. B.