Thu Nov 16 16:52:29 CST 2006
only defined at C level as a static object, all the RNG stuff happens at C
level, and the Python code just calls the C code as necessary. (I'm
sketchy about the details of what is defined as the seed etc.)
This is in contrast with the R RNG facility (the only other RNG facility I
am familiar with), which uses macros SetRNGstate() and GetRNGstate() to
read and write the seed, which is defined at R level.
Therefore, the upshot is that the C routines in ranlib.h read and write
the same seed as the python level functions do, so no special action is
necessary with regard to the seed.
Is this correct?
In any case, it would be nice if something like the above was documented,
so lost souls like myself don't have to go trawling through the source
code to figure out what is going on. Of course it is nice that the source
code is available, otherwise even that would be impossible.
R documents this stuff in the "Writing R Extensions" manual, online at
http://cran.r-project.org/doc/manuals/R-exts.pdf. Perhaps the Numarray
manual could have a small section about this too.
More information about the Numpy-discussion