Boost C++ Libraries: Ticket #9150: multiprecision doesn't work with element_prod of boost::numeric::ublas https://svn.boost.org/trac10/ticket/9150 <p> Consider </p> <pre class="wiki">#include&lt;boost/numeric/ublas/vector.hpp&gt; #include&lt;boost/numeric/ublas/io.hpp&gt; #include&lt;boost/multiprecision/cpp_int.hpp&gt; #include&lt;complex&gt; int main(){ typedef boost::multiprecision::cpp_rational Type; boost::numeric::ublas::vector&lt;Type&gt; a(3, 1), b(3); b(0) = 0; b(1) = Type(-3, 4); b(2) = 2; std::cout&lt;&lt;"a = "&lt;&lt;a&lt;&lt;", b = "&lt;&lt;b; noalias(a) = element_prod(a, b); std::cout&lt;&lt;", a*b = "&lt;&lt;a&lt;&lt;"\n"; return 0; } </pre><p> The output is:<br /> a = <a class="changeset" href="https://svn.boost.org/trac10/changeset/3" title="Tweak disclaimer text">[3]</a>(1,1,1), b = <a class="changeset" href="https://svn.boost.org/trac10/changeset/3" title="Tweak disclaimer text">[3]</a>(0,-3/4,2), a*b = <a class="changeset" href="https://svn.boost.org/trac10/changeset/3" title="Tweak disclaimer text">[3]</a>(0,1,1)<br /> <br /> The same problem exists with mpq_rational. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9150 Trac 1.4.3 anonymous Mon, 23 Sep 2013 05:20:23 GMT summary changed https://svn.boost.org/trac10/ticket/9150#comment:1 https://svn.boost.org/trac10/ticket/9150#comment:1 <ul> <li><strong>summary</strong> <span class="trac-field-old">multiprecision::cpp_rational doesn't work with element_prod of boost::numeric::ublas</span> → <span class="trac-field-new">multiprecision doesn't work with element_prod of boost::numeric::ublas</span> </li> </ul> Ticket anonymous Mon, 23 Sep 2013 05:21:33 GMT <link>https://svn.boost.org/trac10/ticket/9150#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9150#comment:2</guid> <description> <p> The same problem exists for all number&lt;type&gt;. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Mon, 23 Sep 2013 17:49:31 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9150#comment:3 https://svn.boost.org/trac10/ticket/9150#comment:3 <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">worksforme</span> </li> </ul> <p> This works for me for 1.54.0 onwards, can only reproduce in 1.53.0. Can you make doubly sure you're using the latest Boost version? </p> Ticket anonymous Tue, 24 Sep 2013 00:43:11 GMT version changed https://svn.boost.org/trac10/ticket/9150#comment:4 https://svn.boost.org/trac10/ticket/9150#comment:4 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.54.0</span> → <span class="trac-field-new">Boost 1.53.0</span> </li> </ul> Ticket