Re: [Numpy-discussion] random number facilities in numarray and main Python libs
![](https://secure.gravatar.com/avatar/fba1ca56a798d389ac5606cec3b2707d.jpg?s=120&d=mm&r=g)
Hi, The R project (http://www.r-project.org) provides a standalone GPL'ed Math library (buried in the src/nmath/standalone subdirectory of the R code). This includes random number generators for various distributions amongst other goodies. But I have not looked to see what approach that the actual uniform random generator uses (source comment says "A version of Marsaglia-MultiCarry"). However, this library should be as least as good as and probably better than Ranlib that is currently being used I used SWIG to generate wrappers for most of the functions (except the voids). SWIG makes it very easy but I needed to create a SWIG include file because using the header alone did not work correctly. If anyone wants more information or files, let me know. Bruce Southey ---- Original message ----
![](https://secure.gravatar.com/avatar/b3308afd77cbb561a4c676aa091e55fc.jpg?s=120&d=mm&r=g)
On Tue, 7 Sep 2004, Bruce Southey wrote:
Hi,
I'm modestly familiar with R. I think its random number facilities are likely to be as good as anything out there, since it is a tool for computational resarch statistics. Actually R has something like 5 different random number generators, and you can switch from one to the other on the fly. Very cool. I hacked on the random number stuff for something I had to do once, and the code was reasonably clean (C implementation, of course). Since R is GPL'd, I assume it would be possible to use the code in Python. Faheem.
![](https://secure.gravatar.com/avatar/b3308afd77cbb561a4c676aa091e55fc.jpg?s=120&d=mm&r=g)
On Tue, 7 Sep 2004, Bruce Southey wrote:
Sorry for the slow response. Yes, I would be interested in seeing your work. I'd be particularly interested in learning how you interfact the random number generator in python with the one in C. Myself, I'd incline towards a more "manual" approach using the C Python API or possibly the Boost.Python C++ library. Perhaps you can make it publicly available by putting it on the web and posting the url here? Thanks. Faheem.
![](https://secure.gravatar.com/avatar/b3308afd77cbb561a4c676aa091e55fc.jpg?s=120&d=mm&r=g)
On Tue, 7 Sep 2004, Bruce Southey wrote:
Hi,
I'm modestly familiar with R. I think its random number facilities are likely to be as good as anything out there, since it is a tool for computational resarch statistics. Actually R has something like 5 different random number generators, and you can switch from one to the other on the fly. Very cool. I hacked on the random number stuff for something I had to do once, and the code was reasonably clean (C implementation, of course). Since R is GPL'd, I assume it would be possible to use the code in Python. Faheem.
![](https://secure.gravatar.com/avatar/b3308afd77cbb561a4c676aa091e55fc.jpg?s=120&d=mm&r=g)
On Tue, 7 Sep 2004, Bruce Southey wrote:
Sorry for the slow response. Yes, I would be interested in seeing your work. I'd be particularly interested in learning how you interfact the random number generator in python with the one in C. Myself, I'd incline towards a more "manual" approach using the C Python API or possibly the Boost.Python C++ library. Perhaps you can make it publicly available by putting it on the web and posting the url here? Thanks. Faheem.
participants (2)
-
Bruce Southey
-
Faheem Mitha