Flavio Coelho wrote: > Hi, > > anyone know how could I access the Python's builtin mersenne twister > random number generator from Cython? > > I'd like to generate random numbers in the interval [0,1[ faster than > by calling random.random(). I know the implementation of random.random > is in C, but there is the cost of a python call. I want something I > can define as a "cdef extern" in Cython.
You might read the (very good) documentation and code in sage/misc/randstate.pyx. I just noticed that this file has not been converted to rest, so it is not in the reference manual. Ouch; it has such nice documentation! Thanks, Jason -- Jason Grout --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---