Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#8192 closed Bugs (fixed)

dag_shortest_paths or make_reverse_graph problem since 1.48

Reported by: JB Mouret <mouret@…> Owned by: Jeremiah Willcock
Milestone: To Be Determined Component: graph
Version: Boost 1.48.0 Severity: Regression
Keywords: Cc:

Description

The attached code compiles (and works) with boost 1.47 (g++ 4.4.6, GNU/Linux x86) but it does not compile with boost 1.48. The problem persists with the last version (boost 1.53).

g++ -I boost_1_47_0/ dag_test.cpp -> ok

g++ -I boost_1_48_0/ dag_test.cpp -> In file included from boost_1_48_0/boost/graph/topological_sort.hpp:15,

from boost_1_48_0/boost/graph/dag_shortest_paths.hpp:13, from dag_test.cpp:10:

boost_1_48_0/boost/property_map/property_map.hpp: In function 'Reference boost::get(const boost::put_get_helper<Reference, PropertyMap?>&, const K&) [with PropertyMap? = boost::adj_list_edge_property_map<boost::bidirectional_tag, int, int&, long unsigned int, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::edge_weight_t>, Reference = int&, K = boost::detail::reverse_graph_edge_descriptor<boost::detail::edge_desc_impl<boost::bidirectional_tag, long unsigned int> >]': boost_1_48_0/boost/graph/relax.hpp:53: instantiated from 'bool boost::relax(typename boost::graph_traits<Graph>::edge_descriptor, const Graph&, const WeightMap?&, PredecessorMap?&, DistanceMap?&, const BinaryFunction?&, const BinaryPredicate?&) [with Graph = boost::reverse_graph<boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_distance_t, int, boost::no_property>, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::no_property, boost::listS>, main()::graph_t&>, WeightMap? = boost::adj_list_edge_property_map<boost::bidirectional_tag, int, int&, long unsigned int, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::edge_weight_t>, PredecessorMap? = long unsigned int*, DistanceMap? = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_distance_t, int, boost::no_property>, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::no_property, boost::listS>, boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_distance_t, int, boost::no_property>, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::no_property, boost::listS>*, int, int&, boost::vertex_distance_t>, BinaryFunction? = boost::closed_plus<int>, BinaryPredicate? = std::less<int>]' boost_1_48_0/boost/graph/dag_shortest_paths.hpp:64: instantiated from 'void boost::dag_shortest_paths(const VertexListGraph?&, typename boost::graph_traits<Graph>::vertex_descriptor, DistanceMap?, WeightMap?, ColorMap?, PredecessorMap?, DijkstraVisitor?, Compare, Combine, DistInf?, DistZero?) [with VertexListGraph? = boost::reverse_graph<boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_distance_t, int, boost::no_property>, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::no_property, boost::listS>, main()::graph_t&>, DijkstraVisitor? = boost::dijkstra_visitor<boost::null_visitor>, DistanceMap? = boost::vec_adj_list_vertex_property_map<boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_distance_t, int, boost::no_property>, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::no_property, boost::listS>, boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, boost::property<boost::vertex_distance_t, int, boost::no_property>, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::no_property, boost::listS>*, int, int&, boost::vertex_distance_t>, WeightMap? = boost::adj_list_edge_property_map<boost::bidirectional_tag, int, int&, long unsigned int, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::edge_weight_t>, ColorMap? = boost::default_color_type*, PredecessorMap? = long unsigned int*, Compare = std::less<int>, Combine = boost::closed_plus<int>, DistInf? = int, DistZero? = int]' dag_test.cpp:58: instantiated from here boost_1_48_0/boost/property_map/property_map.hpp:354: error: no match for 'operator[]' in '(const boost::adj_list_edge_property_map<boost::bidirectional_tag, int, int&, long unsigned int, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::edge_weight_t>&)((const boost::adj_list_edge_property_map<boost::bidirectional_tag, int, int&, long unsigned int, boost::property<boost::edge_weight_t, int, boost::no_property>, boost::edge_weight_t>*)(& pa))[k]' boost_1_48_0/boost/graph/detail/adjacency_list.hpp:2636: note: candidates are: Ref boost::adj_list_edge_property_map<Directed, Value, Ref, Vertex, Property, Tag>::operator[](boost::detail::edge_desc_impl<Directed, Vertex>) const [with Directed = boost::bidirectional_tag, Value = int, Ref = int&, Vertex = long unsigned int, Property = boost::property<boost::edge_weight_t, int, boost::no_property>, Tag = boost::edge_weight_t]

Attachments (1)

dag_test.cpp (2.2 KB) - added by JB Mouret <mouret@…> 5 years ago.
Test (derived from example/dag_shortest_paths.cpp)

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by JB Mouret <mouret@…>

Attachment: dag_test.cpp added

Test (derived from example/dag_shortest_paths.cpp)

comment:1 Changed 5 years ago by Jeremiah Willcock

Resolution: fixed
Status: newclosed

(In [83191]) Fixed handling of const graphs and property maps; fixes #8192

comment:2 Changed 5 years ago by Jeremiah Willcock

In addition to the bug fix I just put in the trunk, the definition of w_map should be:

property_map<reverse_graph<graph_t>, edge_weight_t>::type w_map =
  get(edge_weight, make_reverse_graph(g));

Note that the code explicitly gets the property map type and the map itself from the reverse graph.

comment:3 in reply to:  2 Changed 5 years ago by JB Mouret <mouret@…>

Thank you for the tip. This was a fast bug fix!

Replying to jewillco:

In addition to the bug fix I just put in the trunk, the definition of w_map should be:

property_map<reverse_graph<graph_t>, edge_weight_t>::type w_map =
  get(edge_weight, make_reverse_graph(g));

Note that the code explicitly gets the property map type and the map itself from the reverse graph.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jeremiah Willcock.
The resolution will be deleted.

Add Comment


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

 
Note: See TracTickets for help on using tickets.