Boost C++ Libraries: Ticket #4399: Make the free function 'size' support the uBLAS traits system and better work with expression types https://svn.boost.org/trac10/ticket/4399 <p> Actually the implementation of the <strong>size</strong> free function has two weak points: </p> <ol><li>It does not make use of the new uBLAS traits system introduced by Gunter.<br /> E.g.: <em>typename ExprT::size_type</em> should become <em>typename matrix_traits&lt;ExprT&gt;::size_type</em> </li></ol><ol start="2"><li>It does not fully support expression types. The current support is error prone and not user-friendly.<br /> E.g.: if <em>ExprT</em> is an expression type and <em>e</em> is a variable of type <em>ExprT</em>, then one has to call <em>size(e())</em> instead of simply <em>size(e)</em>. </li></ol><p> I suggest to change the <strong>size</strong> operation in order to fix the above issues. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4399 Trac 1.4.3 Marco Guazzone <marco.guazzone@…> Fri, 02 Jul 2010 22:12:41 GMT attachment set https://svn.boost.org/trac10/ticket/4399 https://svn.boost.org/trac10/ticket/4399 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">size-allow_expr_and_break_back_comp.patch</span> </li> </ul> <p> Adds the use of uBLAS type traits, simplifies the interaction with expression types, replaces the 'size&lt;tag&gt;' function with the 'size_by_tag&lt;tag&gt;' function. </p> Ticket Marco Guazzone <marco.guazzone@…> Fri, 02 Jul 2010 22:13:22 GMT <link>https://svn.boost.org/trac10/ticket/4399#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4399#comment:1</guid> <description> <p> I've tried to change the 'size' operation without affecting its syntax but I've failed. </p> <p> More specifically, the problem is given by one of the polymorphic version of <em>size</em>: </p> <pre class="wiki"> template &lt;typename TagT, typename ExprT&gt; typename ExprT::size_type size(ExprT const&amp; e); </pre><p> which I've initially transformed into </p> <pre class="wiki"> template &lt;typename TagT, typename MatrixExprT&gt; typename matrix_traits&lt;MatrixExprT&gt;::size_type size(matrix_expression&lt;ExprT&gt; const&amp; me); </pre><p> See the thread <a class="ext-link" href="http://lists.boost.org/MailArchives/ublas/2010/06/4362.php"><span class="icon">​</span>http://lists.boost.org/MailArchives/ublas/2010/06/4362.php</a> for more details. </p> <p> So, my solution is to <strong>break back compatibility</strong> by removing that version of <strong>size</strong> and introducing a new free function (e.g., <strong>size_by_tag</strong>) with the same semantic. </p> <p> I attach a patch for the <strong>size</strong> operation and the related test suite. </p> </description> <category>Ticket</category> </item> <item> <author>Marco Guazzone <marco.guazzone@…></author> <pubDate>Mon, 20 Sep 2010 21:13:05 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4399 https://svn.boost.org/trac10/ticket/4399 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">size-allow_expr.patch</span> </li> </ul> <p> Patch for size.hpp which is back compatible. </p> Ticket Marco Guazzone <marco.guazzone@…> Mon, 20 Sep 2010 21:27:15 GMT <link>https://svn.boost.org/trac10/ticket/4399#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4399#comment:2</guid> <description> <p> At the end I was able to create a patch for size.hpp which does not break back compatibility. So ignore the initially submitted patch (<em>size-allow_expr_and_break_back_comp.patch</em>). </p> <p> I admit the real credits go to Daniel &amp; Stefan, two guys that suggested to me the way to go. For more info see: <a class="ext-link" href="http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/bd5080b28865f826"><span class="icon">​</span>http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/bd5080b28865f826</a> </p> <p> Summary of changes: </p> <ul><li>Use of ublas type-traits system (e.g. typename matrix_traits&lt;M&gt;::size_type). </li><li>Explicit use of matrix_/vector_expression in function arguments (e.g. size(matrix_expression&lt;M&gt; const&amp; m). </li><li>Call to size&lt;1&gt;(v), with v a vector expression, is legal and returns the length of the vector- <br /> <strong><em>Do you like it?</em></strong> </li></ul> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 06 Oct 2010 13:28:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4399#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4399#comment:3</guid> <description> <p> patch applied and commited in trunk </p> </description> <category>Ticket</category> </item> <item> <dc:creator>David Bellot</dc:creator> <pubDate>Sun, 10 Oct 2010 12:29:29 GMT</pubDate> <title>owner, version, milestone changed https://svn.boost.org/trac10/ticket/4399#comment:4 https://svn.boost.org/trac10/ticket/4399#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Gunter</span> to <span class="trac-author">David Bellot</span> </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.44.0</span> → <span class="trac-field-new">Boost Development Trunk</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.44.0</span> → <span class="trac-field-new">Boost-1.45.0</span> </li> </ul> Ticket David Bellot Sun, 10 Oct 2010 12:29:51 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/4399#comment:5 https://svn.boost.org/trac10/ticket/4399#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> Ticket