Normal/Gaussian random number generation for D

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Tue Nov 20 11:25:30 PST 2012


On 11/20/2012 07:00 PM, jerro wrote:
> I agree, it's a good idea to ask the community for feedback. I've replied to you
> in the github thread, but maybe it would be better to continue the discussion here?

I replied in the GitHub thread before reading this email! :-P

My feeling is that the core normal RNG code is probably fairly well defined, and 
won't need too many more tweaks.  What I see lacking right now are unittests (so 
far the ones I've written have just been to test that the type inference rules 
work correctly) and possibly also some additional necessary type constraints 
(e.g. it would be good to have something like isNormalRandomNumberEngine, and I 
don't know if you want to add some extra type checks to some of your 
Ziggurat-related functions).

I'd particularly appreciate it if community members could give the type checking 
a once-over to see if it's adequate/appropriate, whether there are any important 
checks missing and whether in some cases it's actually too strict (e.g. could we 
reasonably replace the isNumeric checks with isScalar?).

As I wrote on GitHub, I also think it's worth considering if some of the helper 
functions/structs introduced in these patches could better be moved out to other 
parts of Phobos for general-purpose use, e.g. your isPowerOfTwo.

Lastly, we need to make sure that this new functionality is well documented. 
Perhaps a good start here could be for people to take a look at the code and 
describe what isn't clear or easy to understand just from looking ... ?

Best wishes,

     -- Joe


More information about the Digitalmars-d mailing list