Thursday, July 9, 2009

Ideal random number generator with long period?

Can anyone recommend a built-in C/C++ (Unix) random number generator? It needs to have a really high period (I'm taking billions) and will eventually be used to generate poisson random numbers.





I'm trying to pick between drand48() and random(). Are there any 64-bit random number generators in the standard libraries?

Ideal random number generator with long period?
MATLAB random number generator is the best .. Or octave for LINUX/UNIX


the 64-bit stuff depends on the machine and the compiler not the language. And if you asking for billions numbers you should generate it in parallel . PETSc has an efficient random generator:





PetscRandomCreate(MPI_Comm comm,PetscRandom *r)
Reply:The only C random number generator which is actually "standard", in the sense of being included in the standard libraries, is rand(). Why not widen your search and look outside the standard libraries?





If you're writing a Poisson random number generator, you might consider coding it in such a way that the user passes it a pointer to a Uniform[0,1] generator to be used in the process, so the choice of generator becomes a user decision.


No comments:

Post a Comment