This is the mail archive of the gsl-discuss@sourceware.org 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]
Other format: [Raw text]

Flat (uniform) random distribution and some development/contributionqueries


Hello all,

While browsing the source code I noticed that the flat/uniform
distribution provided in GSL's randist.h provided only a 'half-open'
interval [a,b) akin to what gsl_rng_uniform() provides for [0,1) and not
also an 'open' interval (a,b) akin to what gsl_rng_uniform_pos()
provides for (0,1).

So I wrote a couple of extra functions, which are attached as a git
patch in case they are useful/welcome.  (Apologies if instead they are
stupid and I'm missing something; this is a very off-the-cuff
contribution, but it seemed easy enough to deliver and trivial enough to
not mind if it's rejected:-)

More general development question, which is the main reason for joining
this list.  A project I'm working on needs to employ random sampling on
several occasions: to be precise, the case of selecting n unique records
from the set {1, ..., N}, as described in these articles:
http://doi.acm.org/10.1145/358105.893
http://doi.acm.org/10.1145/23002.23003
http://doi.acm.org/10.1145/79505.356313

The functionality seems generic and useful enough that I was surprised
not to find a library available.  Anyway, it seems like it would be easy
enough to implement as part of GSL.  Is there interest in having this?
If so, I'll map out a brief API description and/or sample code.

Best wishes,

    -- Joe

Attachment: 0001-Flat-uniform-distribution-over-open-interval.patch.txt
Description: Text document


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