Modify

Ticket #1021 (closed Bugs: fixed)

Opened 7 years ago

Last modified 3 years ago

[Graph][reverse_graph] Problem using reverse_graph adapter with an adapted user defined graph

Reported by: Tony.Tye@… Owned by: jewillco
Milestone: Component: graph
Version: Severity: Problem
Keywords: Cc:

Description

I have had some difficulty using the current version of the reverse_graph adapter on the Boost Graph Library. It seems to require the class being reversed to have types that a user class that has been adapted using graph_traits et al may not have. I have attached an example that shows the problem which includes comments to describe what I think the problem is. I have also attached a modified version of reverse_graph.hpp that works with this example.

-Tony

Attached files:

bug_report_example_skeleton.hpp An include file the contains a minimal user defined graph MyGraph? together with the required interfaces to adapt it to be a Boost Graph.

bug_report_example_reverse_graph.cpp An example showing the problems encountered with the current reverse_graph.hpp

reverse_graph.hpp An altered version of reverse_graph.hpp that works with the example.

Attachments

bug_report_example_skeleton.hpp Download (10.3 KB) - added by anonymous 7 years ago.
bug_report_example_reverse_graph.cpp Download (3.0 KB) - added by anonymous 7 years ago.
reverse_graph.hpp Download (9.6 KB) - added by anonymous 7 years ago.

Change History

Changed 7 years ago by anonymous

Changed 7 years ago by anonymous

Changed 7 years ago by anonymous

comment:1 Changed 7 years ago by eric_niebler

  • Owner set to doug_gregor

comment:2 Changed 6 years ago by dgregor

  • Owner changed from doug_gregor to dgregor

comment:3 Changed 5 years ago by jewillco

  • Owner changed from dgregor to jewillco
  • Status changed from new to assigned

comment:4 Changed 4 years ago by jewillco

  • Status changed from assigned to closed
  • Resolution set to fixed

(In [57902]) Fixed uses of undocumented members of graph types; fixes #1021; fixes #2072

comment:5 Changed 3 years ago by jeff.baumes@…

  • Status changed from closed to reopened
  • Resolution fixed deleted

This bug has been reintroduced as of [64645]. The same example files from 4 years ago cause compile issues, I just needed to update to the new path of property_map.hpp. I believe these six definitions inside the reverse_graph class should be taken out and separated from the class so they are only used when needed:

83	    typedef typename graph_property_type<base_type>::type graph_property_type;
84	    typedef typename graph_bundle_type<base_type>::type graph_bundled;
85	
86	    typedef typename vertex_property_type<base_type>::type vertex_property_type;
87	    typedef typename vertex_bundle_type<base_type>::type vertex_bundled;
88	
89	    typedef typename edge_property_type<base_type>::type edge_property_type;
90	    typedef typename edge_bundle_type<base_type>::type edge_bundled;

The earlier fix fixed some of these, and indeed it looks like vertex_property_type and edge_property_type are now defined two ways, both inside and outside the class:

120	// These are separate so they are not instantiated unless used (see bug 1021)
121	template <class BidirectionalGraph, class GraphRef>
122	struct vertex_property_type<reverse_graph<BidirectionalGraph, GraphRef> > {
123	  typedef typename boost::vertex_property_type<BidirectionalGraph>::type type;
124	};
125	
126	template <class BidirectionalGraph, class GraphRef>
127	struct edge_property_type<reverse_graph<BidirectionalGraph, GraphRef> > {
128	  typedef typename boost::edge_property_type<BidirectionalGraph>::type type;
129	};

comment:6 Changed 3 years ago by jewillco

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [66907]) Fixed up computation of property types; fixes #1021

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.