Boost C++ Libraries: Ticket #3972: Broken support for unordered sets and multisets in adjacency_list graphs https://svn.boost.org/trac10/ticket/3972 <p> Hello, </p> <p> The support for adjacency_list graphs using unordered sets and multisets is currently broken. I will attach a patch that solves this issues in this report. </p> <p> Basically, several compounds are missing and there is a bug in edge_range(). Here is a detailed description of the issue: </p> <ul><li>Container traits </li></ul><p> container_traits, container_category, and iterator_stability specializations and overrides are missing for unordered_multiset and unordered_multimap, in pending/container_traits.hpp. </p> <ul><li>parallel_edge_traits </li></ul><p> parallel_edge_traits specializations are missing for hash_multisetS and hash_multimapS, in graph/adjacency_list.hpp. </p> <ul><li>edge_range </li></ul><p> edge_range() uses std::equal_range() on the node's out edge list. std::equal_range() expects its input to be ordered in ascending order. This precondition fails when using an unordered set or multiset for storing the edges. </p> <p> As a solution, the proposed patch uses std::equal_range() by default, except on associative containers, for which it uses the container's equal_range() method (the equal_range() method is a requirement of associative containers). </p> <p> Regards, Thomas Claveirole </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3972 Trac 1.4.3 Thomas Claveirole <thomas@…> Wed, 03 Mar 2010 14:03:18 GMT attachment set https://svn.boost.org/trac10/ticket/3972 https://svn.boost.org/trac10/ticket/3972 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">unordered-adjacency_list.patch</span> </li> </ul> <p> Patch that solves the described issue. </p> Ticket Thomas Claveirole <thomas@…> Wed, 03 Mar 2010 14:30:45 GMT attachment set https://svn.boost.org/trac10/ticket/3972 https://svn.boost.org/trac10/ticket/3972 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">unordered-adjacency_list.2.patch</span> </li> </ul> <p> Sorry, the previous patch has a minor bug. This one is correct. </p> Ticket Jeremiah Willcock Wed, 03 Mar 2010 17:19:15 GMT owner, status changed https://svn.boost.org/trac10/ticket/3972#comment:1 https://svn.boost.org/trac10/ticket/3972#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Andrew Sutton</span> to <span class="trac-author">Jeremiah Willcock</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> I agree with your bug. Could you please change the copyright message to you, though, since your patch adds so much code? With that I think I can apply it soon. </p> Ticket Thomas Claveirole <thomas@…> Fri, 05 Mar 2010 11:03:10 GMT attachment set https://svn.boost.org/trac10/ticket/3972 https://svn.boost.org/trac10/ticket/3972 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">unordered-adjacency_list.3.patch</span> </li> </ul> <p> Same as unordered-adjacency_list.2.patch with updated copyright notices. </p> Ticket Thomas Claveirole <thomas@…> Fri, 05 Mar 2010 11:03:57 GMT <link>https://svn.boost.org/trac10/ticket/3972#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3972#comment:2</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/3972#comment:1" title="Comment 1">jewillco</a>: </p> <blockquote class="citation"> <p> Could you please change the copyright message to you, though, since your patch adds so much code? </p> </blockquote> <p> Sure. Here is a new patch. It adds a copyright line with my name and current year. Is this OK, or should I rather modify the existing lines? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Fri, 05 Mar 2010 18:27:45 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3972#comment:3 https://svn.boost.org/trac10/ticket/3972#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/60198" title="Added in container_traits and adjacency_list patches to fix unordered ...">[60198]</a>) Added in container_traits and adjacency_list patches to fix unordered container issues (patch from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3972" title="#3972: Bugs: Broken support for unordered sets and multisets in adjacency_list graphs (closed: fixed)">#3972</a>); fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3972" title="#3972: Bugs: Broken support for unordered sets and multisets in adjacency_list graphs (closed: fixed)">#3972</a> </p> Ticket Jeremiah Willcock Fri, 05 Mar 2010 18:29:01 GMT <link>https://svn.boost.org/trac10/ticket/3972#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3972#comment:4</guid> <description> <p> This should be fixed now -- I moved the equal_range stuff to container_traits, and it turns out that the iterators are actually unstable, not stable as was in the patch. </p> </description> <category>Ticket</category> </item> <item> <author>Ignacy Gawedzki <i@…></author> <pubDate>Thu, 18 Mar 2010 23:57:01 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/3972 https://svn.boost.org/trac10/ticket/3972 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">unordered_equal_range_dispatch.patch</span> </li> </ul> <p> Fix equal_range dispatch and container categories </p> Ticket Ignacy Gawedzki <i@…> Fri, 19 Mar 2010 00:04:35 GMT status changed; cc set; resolution deleted https://svn.boost.org/trac10/ticket/3972#comment:5 https://svn.boost.org/trac10/ticket/3972#comment:5 <ul> <li><strong>cc</strong> <span class="trac-author">i@…</span> added </li> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> The actual dispatch functions for equal_range, as per <a class="changeset" href="https://svn.boost.org/trac10/changeset/60698" title="Boost.Bitfield: * Updating macros ">r60698</a>, don't work as expected. As a result std::equal_range is always used. The default dispatch function should take a container_tag as argument and not a template parameter, since the latter always takes precedence. </p> <p> Besides, unordered_{set,multiset,map,multimap} should have their own tags which aren't subclasses of sorter_associative_container_tag. </p> <p> The attached patch corrects those two issues. </p> Ticket Jeremiah Willcock Sun, 28 Mar 2010 18:00:31 GMT <link>https://svn.boost.org/trac10/ticket/3972#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3972#comment:6</guid> <description> <p> Could you please add a copyright notice with your name at the top of the file (i.e., rebuild your patch with that change) rather than updating the year on the existing notice? I should be able to apply your patch after that. Thank you. </p> </description> <category>Ticket</category> </item> <item> <author>i@…</author> <pubDate>Sun, 28 Mar 2010 18:56:53 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/3972 https://svn.boost.org/trac10/ticket/3972 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">unordered_equal_range_dispatch.2.patch</span> </li> </ul> <p> Corrected copyright lines. </p> Ticket Jeremiah Willcock Fri, 02 Apr 2010 15:06:14 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3972#comment:7 https://svn.boost.org/trac10/ticket/3972#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/60999" title="Applied another patch (unordered_equal_range_dispatch.2.patch) from ...">[60999]</a>) Applied another patch (unordered_equal_range_dispatch.2.patch) from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3972" title="#3972: Bugs: Broken support for unordered sets and multisets in adjacency_list graphs (closed: fixed)">#3972</a>; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3972" title="#3972: Bugs: Broken support for unordered sets and multisets in adjacency_list graphs (closed: fixed)">#3972</a> </p> Ticket