From: Brian Gough <bjg@gnu.org>
To: Joseph Wakeling <joseph.wakeling@webdrake.net>
Cc: gsl-discuss@sourceware.org
Subject: Re: Flat (uniform) random distribution and some development/contribution queries
Date: Tue, 11 May 2010 14:42:00 -0000 [thread overview]
Message-ID: <43fx1yilox.wl%bjg@gnu.org> (raw)
In-Reply-To: <4BE7EAAD.20603@webdrake.net>
At Mon, 10 May 2010 13:14:53 +0200,
Joseph Wakeling wrote:
> 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:-)
Thanks, I will correct the comment. I don't think I will include the
additional functions in this case as they are so similar to the
existing ones.
> 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
I think this is what gsl_ran_choose does. The implementation isn't as
efficient as those described but it gives the same result.
--
Brian Gough
next prev parent reply other threads:[~2010-05-11 14:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-10 11:15 Joseph Wakeling
2010-05-10 14:23 ` Joseph Wakeling
2010-05-11 14:42 ` Brian Gough
2010-05-11 14:42 ` Brian Gough [this message]
2010-05-11 15:35 ` Joseph Wakeling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43fx1yilox.wl%bjg@gnu.org \
--to=bjg@gnu.org \
--cc=gsl-discuss@sourceware.org \
--cc=joseph.wakeling@webdrake.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).