This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] libstdc++: add uniform on sphere distribution
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Ulrich Drepper <drepper at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Wed, 23 Jul 2014 11:58:24 +0200 (CEST)
- Subject: Re: [PATCH] libstdc++: add uniform on sphere distribution
- Authentication-results: sourceware.org; auth=none
- References: <87a98eow4m dot fsf at x240 dot local dot i-did-not-set--mail-host-address--so-tickle-me>
- Reply-to: libstdc++ at gcc dot gnu dot org
On Sat, 12 Jul 2014, Ulrich Drepper wrote:
Ed's submission of the logistic regression distribution caused problems
for me because, like Ed, I have changes to the <ext/random> header in my
tree for a long time. Time to submit them.
This first one is a new distribution. It generates coordinates for
random points on a unit sphere in arbitrarily many dimensions. This
distribution by itself is useful but if I get some other code fully
implemented it will also form the basis for yet another, more
sophisticated distribution.
Hello,
I have 2 questions :
* can't we end up dividing by 0 if all values of the normal distribution
happen to be 0?
* should the implementation be specialized for small dimensions to avoid
the normal distributions and instead generate points in a square/cube
until they fall in the disk/ball?
--
Marc Glisse