This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: [PATCH] libstdc++: add uniform on sphere distribution


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


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