Closed kjs73 closed 8 years ago
cool, I never saw that particular method, I wonder if it's actually faster than the method I mentioned. I guess the only difference is drawing from an exponential distribution vs a power law distribution.
yeah, 3 dimensions is a marginal case. You would have to do benchmarking to be sure. But probably the takestep routine is not going to be the bottleneck for most calculations, so I would use the one that generalizes well.
Spherical sampling is now changed to the method described in the reference and, e.g. in Numerical Recipes, 3rd ed., p. 1129. Can this be merged?
Hi Julian, it looks good. My comments were just suggestions, so i would say pull whenever you're ready. (I didn't check whether it was correct, I'll assume it works as it's supposed to).
Adds uniform sampling of points in n-dimensional spheres and cubes. This is useful for some direct sampling applications.