Boost C++ Libraries: Ticket #7549: uBLAS banded storage does not match common BLAS layout (from netlib) https://svn.boost.org/trac10/ticket/7549 <p> A banded_matrix stores the elements in an unusual way. This makes it impossible to call standard BLAS-libraries with these matrix type. </p> <p> Example data taken from <a class="ext-link" href="http://www.netlib.org/lapack/lug/node124.html"><span class="icon">​</span>http://www.netlib.org/lapack/lug/node124.html</a> </p> <pre class="wiki">Running banded_matrix &lt; column_major &gt; test Full matrix [5,5]((11,12,0,0,0),(21,22,23,0,0),(31,32,33,34,0),(0,42,43,44,45),(0,0,53,54,55)) data() of matrix 0 12 23 34 45 11 22 33 44 55 21 32 43 54 0 31 42 53 0 0 Expected data() of matrix 0 11 21 31 12 22 32 42 23 33 43 53 34 44 54 0 45 55 0 0 </pre><pre class="wiki">Running banded_matrix &lt; row_major &gt; test Full matrix [5,5]((11,12,0,0,0),(21,22,23,0,0),(31,32,33,34,0),(0,42,43,44,45),(0,0,53,54,55)) data() of matrix 0 11 21 31 12 22 32 42 23 33 43 53 34 44 54 0 45 55 0 0 Expected data() of matrix 0 0 11 12 0 21 22 23 31 32 33 34 42 43 44 45 53 54 55 0 </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7549 Trac 1.4.3 Gunter Sun, 21 Oct 2012 20:40:40 GMT <link>https://svn.boost.org/trac10/ticket/7549#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7549#comment:1</guid> <description> <p> using the define <code>BOOST_UBLAS_OWN_BANDED</code> makes the things even worse ... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Gunter</dc:creator> <pubDate>Sun, 21 Oct 2012 20:45:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7549#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7549#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81043" title="* libs/numeric/ublas/test/test_banded_storage_layout.cpp - new failing ...">[81043]</a>) </p> <ul><li>libs/numeric/ublas/test/test_banded_storage_layout.cpp - new failing test, see <a class="new ticket" href="https://svn.boost.org/trac10/ticket/7549" title="#7549: Bugs: uBLAS banded storage does not match common BLAS layout (from netlib) (new)">#7549</a> </li><li>libs/numeric/ublas/test/Jamfile.v2 - add test to test suite </li></ul> </description> <category>Ticket</category> </item> <item> <dc:creator>Gunter</dc:creator> <pubDate>Sun, 21 Oct 2012 20:54:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7549#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7549#comment:3</guid> <description> <p> The responsible code is in <code>banded.hpp</code> around line 163. The mapping from index (i,j) to storage location is </p> <pre class="wiki"> const size_type k = j; const size_type l = upper_ + i - j; if (k &lt; size2_ &amp;&amp; l &lt; lower_ + 1 + upper_) return data () [layout_type::element (k, size2_, l, lower_ + 1 + upper_)]; </pre><p> where <code>layout_type</code> is either <code>basic_row_major</code> or <code>basic_column_major</code> (from <code>functional.hpp</code>) We should extract the existing mapping logic to a functor (similar to triangular types <code>basic_lower</code> and <code>basic_upper</code>) and introduce a new template argument. </p> </description> <category>Ticket</category> </item> <item> <author>nasos_i@…</author> <pubDate>Wed, 31 Jul 2013 15:11:04 GMT</pubDate> <title>cc changed https://svn.boost.org/trac10/ticket/7549#comment:4 https://svn.boost.org/trac10/ticket/7549#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">Rutger</span> <span class="trac-author">ter</span> <span class="trac-author">Borg</span> <span class="trac-author">&lt;rutger@…&gt;</span> added; <span class="trac-author">Rutger ter Borg &lt;rutger@…&gt;</span> removed </li> </ul> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/7549#comment:2" title="Comment 2">guwi17</a>: </p> <blockquote class="citation"> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81043" title="* libs/numeric/ublas/test/test_banded_storage_layout.cpp - new failing ...">[81043]</a>) </p> <ul><li>libs/numeric/ublas/test/test_banded_storage_layout.cpp - new failing test, see <a class="new ticket" href="https://svn.boost.org/trac10/ticket/7549" title="#7549: Bugs: uBLAS banded storage does not match common BLAS layout (from netlib) (new)">#7549</a> </li><li>libs/numeric/ublas/test/Jamfile.v2 - add test to test suite </li></ul></blockquote> <p> I am trying to fix this bug. So I am wondering why should the expected row-major data layout be: </p> <p> 0, 0, 11, 12, 0, 21, 22, 23, 31, 32, 33, 34, 42, 43, 44, 45, 53, 54, 55, 0 ? </p> <p> I would expect something like: </p> <p> 0, 12, 23, 34, 45, 11, 22, 33, 44, 55, 21, 32, 43, 54, 0, 31, 42, 53, 0, 0 </p> <p> -Nasos </p> Ticket nasos_i@… Wed, 02 Apr 2014 14:52:36 GMT <link>https://svn.boost.org/trac10/ticket/7549#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7549#comment:5</guid> <description> <p> The bug is corrected in the ublas_develop branch in github and some more test cases were introduced. To enable the old incorrect behaviour one should define BOOST_UBLAS_LEGACY_BANDED. </p> <p> -Nasos </p> </description> <category>Ticket</category> </item> </channel> </rss>