Advice on Library Interface

David Roundy droundy@abridgegame.org
Wed, 7 May 2003 14:38:07 -0400


On Wed, May 07, 2003 at 11:18:01AM -0400, Matthew Donadio wrote:
> 
> 1.  Should the functions generate the necessary uniforms, or accept a
> list of uniforms?  In other words, shuld the signature be
> 
> 	wgn :: Int      -- ^ seed to generate the uniforms
>             -> [Double] -- ^ list of Gaussian random variables
> 
> or
> 
> 	wgn :: [Double] -- ^ list of uniform random variables
>             -> [Double] -- ^ list of Gaussian random variables
> 
> The first is what I currently have implemented, but the second is more
> flexible.

I'd say the second.  I wasted a month or two one summer due to the cruddy
random number generator in Numerical Recipes first edition, and don't trust
most random number generators.  Generators optimized for speed (which I
imagine is what you want for DSP work) often have severe flaws in the
quality of their random numbers.
-- 
David Roundy
http://civet.berkeley.edu/droundy/