[Numpy-discussion] in place random generation

Travis Oliphant oliphant@ee.byu....
Mon Mar 12 11:33:13 CDT 2007

Mark P. Miller wrote:

>Robert:  Just a thought on this topic:
>Would it be possible for the Scipy folks to add a new module based 
>solely off your old mtrand code (pre-broadcast)?  I have to say that the 
>mtrand code from numpy 0.9.8 has some excellent advantages over the core 
>python random number generators.
I'm not convinced that the broadcasting is causing the slow-downs.  
Currently, the code has two path-ways.  One gets called when the inputs 
are scalars which is equivalent to the old code and the second gets 
called when broadcasting is desired.  Their should be only a very small 
speed hit because of the check.   So, it should be possible to do both 
without great differences in speed. 

Perhaps the speed hit is due to something else (like creating 0-d arrays 
from scalars, or something similar).    So, in other words, I think the 
problem is fixable, but we need someone who can track down where the 
slowness is coming from.


More information about the Numpy-discussion mailing list