This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: slib's random number generator is broken


Mark Galassi <rosalia@cygnus.com> writes:

>     >> Tomorrow's snapshot contains a new built in generator.
>     >>
>     Klaus> Will it be based on the GNU Scientific Lib (gsl) by
>     Klaus> M. Galassi?
> 
> Note that I didn't write all of GSL: only a part of it (and I
> coordinate it).  James Theiler wrote the excellent random number
> stuff.
> 
> But I doubt that it can be used in Guile directly because it would
> need a copyright assignment form.  Unfortunately James works for Los
> Alamos, which means that it would take forever for that to happen.

To answer Klaus: No, the random number generator is included in
random.c.  I did not use GSL.  I think this is good because random.c
should be distributed with guile-core (it is currently even linked
into libguile).  In this way there won't be any dependency on GSL.

But I've included a "plug in" interface so that it is easy to use a
different RNG, e.g. the one in GSL.

I haven't looked at the GSL RNG, but it is my intention that the RNG
in random.c should be excellent as well.  In fact, it is the ambition
that it should be an optimal balance between quality and efficiency. :)

If someone can point out possible improvements, then please do so!
(I can say already that there are some good optimizations (good =
 doesn't make the code too ugly) one could do in scm_i_random_bignum.)

/mdj