This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC 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: Jonathan Wakely <jwakely at redhat dot com>, libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Sat, 9 Aug 2014 09:15:33 +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> <alpine dot DEB dot 2 dot 11 dot 1407231149300 dot 1768 at laptop-mg dot saclay dot inria dot fr> <20140723102908 dot GM2361 at redhat dot com> <87d2catvi3 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 Fri, 8 Aug 2014, Ulrich Drepper wrote:
Now also for a fix of the sphere distribution. Unless someone objects
I'll check in the patch below.
2014-08-08 Ulrich Drepper <drepper@gmail.com>
* include/ext/random.tcc
(uniform_on_sphere_distribution::__generate_impl): Reject
vectors with norm zero.
While there, do we want to also reject infinite norms?
I would have done: while (__sum < small || __sum > large)
but testing exactly for 0 and infinity seems good enough.
--
Marc Glisse