Boost C++ Libraries: Ticket #4549: vector/matrix_assign do not work for integral types https://svn.boost.org/trac10/ticket/4549 <p> I have found a possible problem in <code>vector_assign</code> and <code>matrix_assign</code> functions when vector and matrix values have integral type. </p> <p> For instance, when you try to assign two integral vectors (e.g., <code>ublas::vector&lt;int&gt;</code>), you'll end up with the following runtime assertion: </p> <pre class="wiki">Check failed in file boost-trunk/boost/numeric/ublas/detail/vector_assign.hpp at line 370: detail::expression_type_check (v, cv) terminate called after throwing an instance of 'boost::numeric::ublas::external_logic' what(): external logic or bad condition of inputs Aborted (core dumped) </pre><p> Similar exception will be thrown for integral matrices. </p> <p> I have identified two possible issues: </p> <ol><li>In <em>detail/vector_assign.hpp</em> and <em>detail/matrix_assign.hpp</em>, the check in function <code>detail::equals</code> should use <code>&lt;=</code> instead of <code>&lt;</code>. </li></ol><ol start="2"><li>In <em>detail/config.hpp</em>, macro <code>BOOST_UBLAS_TYPE_CHECK_MIN</code> should get zero for integral types. </li></ol> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4549 Trac 1.4.3 Marco Guazzone <marco.guazzone@…> Tue, 17 Aug 2010 09:49:25 GMT attachment set https://svn.boost.org/trac10/ticket/4549 https://svn.boost.org/trac10/ticket/4549 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">vector_matrix_assign-allow_integral_types.patch</span> </li> </ul> <p> Possible solution. </p> Ticket Marco Guazzone <marco.guazzone@…> Tue, 17 Aug 2010 09:50:45 GMT attachment set https://svn.boost.org/trac10/ticket/4549 https://svn.boost.org/trac10/ticket/4549 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test_ticket4549.cpp</span> </li> </ul> <p> Test case: test copy-construction/-assignement of an integral vector and an integral matrix. The test fails to run if the proposed patch is not applied. </p> Ticket Jonathan Jones <jonathan.jones@…> Fri, 29 Jun 2012 21:11:26 GMT cc set https://svn.boost.org/trac10/ticket/4549#comment:1 https://svn.boost.org/trac10/ticket/4549#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">jonathan.jones@…</span> added </li> </ul> Ticket marco.guazzone@… Mon, 27 Aug 2012 14:40:23 GMT <link>https://svn.boost.org/trac10/ticket/4549#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4549#comment:2</guid> <description> <p> It seems that this patch has been never added to the repo. I cannot see it in current svn trunk. </p> <p> Since I've realized that one of the involved files is changed (i.e., <code>boost/numeric/ublas/detail/config.hpp</code>), I add a new patch to fit actual changes. </p> <p> The test file that I've already attached is still OK. </p> </description> <category>Ticket</category> </item> <item> <author>marco.guazzone@…</author> <pubDate>Mon, 27 Aug 2012 14:42:02 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4549 https://svn.boost.org/trac10/ticket/4549 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">vector_matrix_assign-allow_integral_types-20120827.patch</span> </li> </ul> <p> Patch file changed to fit actual (Boost 1.51) changes. </p> Ticket sudhanshu.gupta05@… Wed, 23 May 2018 06:20:47 GMT <link>https://svn.boost.org/trac10/ticket/4549#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4549#comment:3</guid> <description> <p> When I ran the attached test case , it works for integral vector but not integral matrix for Boost 1.65.1 . Please let me know if we have fix for integral matrix ? </p> <p> Thanks </p> </description> <category>Ticket</category> </item> </channel> </rss>