Boost C++ Libraries: Ticket #11454: uniform_on_sphere.cpp incorrect for 1D vectors https://svn.boost.org/trac10/ticket/11454 <p> On OSX 10.10 with Boost 1.58, the boost::uniform_on_sphere distribution returns incorrect 1D "vectors" that have a magnitude that is not equal to 1. I believe that the bug exists from 1.56 onwards. </p> <p> Attached is a minimum working example that demonstrates the bug. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11454 Trac 1.4.3 jon.gammell@… Tue, 07 Jul 2015 17:50:08 GMT attachment set https://svn.boost.org/trac10/ticket/11454 https://svn.boost.org/trac10/ticket/11454 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">mwe_osx.cpp</span> </li> </ul> <p> minimum working example of bug </p> Ticket jon.gammell@… Tue, 07 Jul 2015 17:55:29 GMT <link>https://svn.boost.org/trac10/ticket/11454#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11454#comment:1</guid> <description> <p> I believe the error is a missing break statement in the 1D case of the switch. </p> <p> I've got a patch ready to test, but I don't have direct access to the affected machine. I will follow up with the results when the test is run. </p> </description> <category>Ticket</category> </item> <item> <author>jon.gammell@…</author> <pubDate>Tue, 07 Jul 2015 18:05:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11454#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11454#comment:2</guid> <description> <p> Specifically, inserted at <a class="ext-link" href="https://github.com/boostorg/random/blob/master/include/boost/random/uniform_on_sphere.hpp#L175"><span class="icon">​</span>Line 175</a> of uniform_on_sphere.hpp </p> </description> <category>Ticket</category> </item> <item> <author>jon.gammell@…</author> <pubDate>Tue, 07 Jul 2015 18:09:55 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/11454 https://svn.boost.org/trac10/ticket/11454 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">uniform_on_sphere.hpp.patch</span> </li> </ul> <p> Proposed fix </p> Ticket jon.gammell@… Tue, 07 Jul 2015 18:13:58 GMT <link>https://svn.boost.org/trac10/ticket/11454#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11454#comment:3</guid> <description> <p> I've verified that the attached patch appears to fix the problem. </p> </description> <category>Ticket</category> </item> <item> <author>mmoll@…</author> <pubDate>Tue, 15 Sep 2015 20:53:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11454#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11454#comment:4</guid> <description> <p> I added a pull request on github: <a class="ext-link" href="https://github.com/boostorg/random/pull/21"><span class="icon">​</span>https://github.com/boostorg/random/pull/21</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Sat, 13 Feb 2016 20:57:14 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11454#comment:5 https://svn.boost.org/trac10/ticket/11454#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in <a class="ext-link" href="https://github.com/boostorg/random/commit/29e8bd59a24ac2f6023c3706916f829b0d416297"><span class="icon">​</span>https://github.com/boostorg/random/commit/29e8bd59a24ac2f6023c3706916f829b0d416297</a> </p> Ticket