This is the mail archive of the gsl-discuss@sourceware.cygnus.com mailing list for the GSL project.


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

GSL and Swarm random objects compared (fwd)




---------- Forwarded message ----------
Date: Thu, 15 Apr 1999 09:55:37 -0500
From: "Sven N. Thommesen" <sthomme@humsci.auburn.edu>
To: James Theiler <jt@lanl.gov>
Cc: gsl-discuss@sourceware.cygnus.com
Subject: GSL and Swarm random objects compared

[James -- please fwd to gsl-discuss. I have tried to subscribe, but my
messages get blocked because the university's mail server is in the ORBS
database as 'insecure'. I'm on the administrator's case ;-) ]

James,

it is interesting to compare the random libraries in GSL and in Swarm,
given that we tried to provide similar basic functionality. Even so, there
are several differences. I have listed some of them below, in case you
should want to use any of my ideas. I shall, of course, crib what I find
useful in yours! 

(Of course, if the licensing issues did not stand in the way, I could
contribute to GSL and Swarm could use GSL, to everyone's benefit ;-)

1. The objects (algorithms) implemented:

(a) although GSL has 39 different generators and Swarm 36, there is only a
5-generator overlap! 
 Some of GSL's generators (r250, gfsr4, taus) I'd like to import to Swarm;
and of the Swarm generators not in GSL there are several that have passed
Diehard and could usefully be added to GSL.

(b) in the distribution department, GSL puts Swarm to shame -- I had only
implemented the most basic ones. Filling in what's missing was on my to-do
list -- or it was, until I discovered GSL. Hope we find a way for me to use
yours!


2. Functionality implemented:

It is also the case that we have implemented fairly non-overlapping sets of
capabilities!  Below I list some capabilities in one library but not in the
other:

(a) for the generators:

a.1 GSL generators return doubles both in [0,1) and in  (0,1)
a.2 GSL generators return unsigneds both in [min,max] and in [0,a]
a.3 GSL generators keep track of separate MIN and MAX for each
generator/algorithm (Swarm shifts output down if needed so that all
generators have output in [0, max']
a.4 GSL generators allow for a "default seed" taken from the literature
a.5 GSL generators allow the specification of default generator and seed on
the command line

a.6 Swarm generators accept either a single seed, or a seed vector (of
generator-dependent length) to give the user complete control
a.7 Swarm generators allow for a randomized starting seed, to ensure
different successive runs
a.8 Swarm generators allow for antithetic output ( = 1.0 - d)
a.9 Swarm generators keep a count of the number of variates generated

(b) for the distributions:

b.1 GSL distributions have a function to return the PDF for a given x value
b.2 GSL distributions obtain their generator output from whatever generator
is specified for each call

b.3 Swarm distributions assign a generator to each distribution object for
the duration (though the same generator may be set to feed more than one
distribution object)
b.4 Swarm distributions keep a count of the number of variates returned
b.5 Swarm distributions know how to deal with L'Ecuyer's 'split' generators
(since Swarm has implemented two of them)
b.6 Swarm distributions allow for the setting of default parameters as well
as the use of call-by-call parameters

b.7 I've had requests for something that's not in either library: an
'empirical' distribution, whose pdf is built from user-supplied data ...

There's definitely an argument to be made for keeping a general library
like GSL 'lean' in features, and some of the Swarm functionality is perhaps
best implemented in whatever object wrappers people add to GSL. I'm
offering up the above list in case you find any ideas there worth using in GSL.

If you'd like to use any of my generators, I have no objection. If you'd
like me to do the work, I might have some time later this summer.

Cheers,
Sven Thommesen
Auburn University



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