Re: Add uniform_inside_sphere_distribution

2016-10-27 Thread Jonathan Wakely
On 27/10/16 15:33 +0200, Andreas Schwab wrote: On Okt 26 2016, Jonathan Wakely wrote: In all the new tests please replace this dg-options directive with: { dg-do run { target cxx11 } } ERROR: ext/random/uniform_inside_sphere_distribution/cons/default.cc: syntax error in target selector "t

Re: Add uniform_inside_sphere_distribution

2016-10-27 Thread Andreas Schwab
On Okt 26 2016, Jonathan Wakely wrote: > In all the new tests please replace this dg-options directive with: > > { dg-do run { target cxx11 } } ERROR: ext/random/uniform_inside_sphere_distribution/cons/default.cc: syntax error in target selector "target cxx11" for " dg-do 1 run { target cxx11

Re: Add uniform_inside_sphere_distribution

2016-10-26 Thread Ed Smith-Rowland
On 10/26/2016 05:01 AM, Jonathan Wakely wrote: On 25/10/16 08:20 -0400, Ed Smith-Rowland wrote: +explicit +param_type(_RealType __radius = _RealType(1)) +: _M_radius(__radius) +{ + _GLIBCXX_DEBUG_ASSERT(_M_radius > _RealType(0)); Nowadays we're able to do cheaper assertion

Re: Add uniform_inside_sphere_distribution

2016-10-26 Thread Jonathan Wakely
On 25/10/16 08:20 -0400, Ed Smith-Rowland wrote: + explicit + param_type(_RealType __radius = _RealType(1)) + : _M_radius(__radius) + { + _GLIBCXX_DEBUG_ASSERT(_M_radius > _RealType(0)); Nowadays we're able to do cheaper assertions when _GLIBCXX_ASSERTIONS is def

Re: Add uniform_inside_sphere_distribution

2016-10-25 Thread Ed Smith-Rowland
All, Here is the library extension for uniform_inside _sphere_distribution. It works from discs and has been tested up through 12-dimentional spheres. The patch dispatches to rejection for Dim<8, transform otherwise as discussed earlier. Builds and tests cleanly on x86_64-linux. OK? Ed Inde

Re: Add uniform_inside_sphere_distribution

2014-11-06 Thread Ed Smith-Rowland
On 11/06/2014 02:23 AM, Marc Glisse wrote: On Wed, 5 Nov 2014, Ed Smith-Rowland wrote: On 11/05/2014 04:25 PM, Marc Glisse wrote: On Wed, 5 Nov 2014, Ed Smith-Rowland wrote: Like the uniform_on_sphere_distribution which is used inside, the 2-dimensional case uses rejection Could you point

Re: Add uniform_inside_sphere_distribution

2014-11-05 Thread Marc Glisse
On Wed, 5 Nov 2014, Ed Smith-Rowland wrote: On 11/05/2014 04:25 PM, Marc Glisse wrote: On Wed, 5 Nov 2014, Ed Smith-Rowland wrote: Like the uniform_on_sphere_distribution which is used inside, the 2-dimensional case uses rejection Could you point out where in the code you are special-casing

Re: Add uniform_inside_sphere_distribution

2014-11-05 Thread Ed Smith-Rowland
On 11/05/2014 04:25 PM, Marc Glisse wrote: On Wed, 5 Nov 2014, Ed Smith-Rowland wrote: Like the uniform_on_sphere_distribution which is used inside, the 2-dimensional case uses rejection Could you point out where in the code you are special-casing dimension 2? Somehow I can't see it in the p

Re: Add uniform_inside_sphere_distribution

2014-11-05 Thread Marc Glisse
On Wed, 5 Nov 2014, Ed Smith-Rowland wrote: Like the uniform_on_sphere_distribution which is used inside, the 2-dimensional case uses rejection Could you point out where in the code you are special-casing dimension 2? Somehow I can't see it in the patch. -- Marc Glisse