I am not sure if this is related to
boost graph library directed multigraph edge_range bug
but I cannot use edge_range
with directedS
and got different errors from the above link. Changing directedS
to nondirectedS
makes it work but it is not what I want.
If this does not work, do we have other ways to check parallel edges between nodes rather than using
boost::out_edges
When my graph allows parallel edges, what
boost::edge(u, v, G)
returns to me? The first edge?
Thank you.
#include <boost/graph/adjacency_list.hpp>
typedef boost::adjacency_list<
boost::multisetS,
boost::vecS,
boost::directedS,
boost::no_property,
boost::no_property,
boost::no_property,
boost::setS
> Graph;
typedef typename boost::graph_traits<Graph>::vertex_descriptor Vertex;
typedef typename boost::graph_traits<Graph>::edge_descriptor Edge;
void test(Edge aE, const Graph &aG) {
Vertex sv = boost::source(aE, aG);
Vertex tv = boost::target(aE, aG);
typename boost::graph_traits<Graph>::out_edge_iterator it, eit;
for (boost::tie(it, eit) = boost::edge_range(sv, tv, aG);
it != eit;
++it) {
}
}
Message
In file included from .../glnxa64/boost/include/boost/graph/adjacency_list.hpp:370:0,
from sl_execgraph/Test.cpp:2:
.../glnxa64/boost/include/boost/graph/detail/adjacency_list.hpp: In instantiation of ‘std::pair<typename Config::out_edge_iterator, typename Config::out_edge_iterator> boost::edge_range(typename Config::vertex_descriptor, typename Config::vertex_descriptor, const boost::adj_list_helper<Config, Base>&) [with Config = boost::detail::adj_list_gen<boost::adjacency_list<boost::multisetS, boost::vecS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::setS>, boost::vecS, boost::multisetS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::setS>::config; Base = boost::directed_graph_helper<boost::detail::adj_list_gen<boost::adjacency_list<boost::multisetS, boost::vecS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::setS>, boost::vecS, boost::multisetS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::setS>::config>; typename Config::out_edge_iterator = boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::sep_<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>; typename Config::vertex_descriptor = long unsigned int]’:
sl_execgraph/Test.cpp:21:60: required from here
.../glnxa64/boost/include/boost/graph/detail/adjacency_list.hpp:1625:7: error: no matching function for call to ‘boost::detail::sep_<long unsigned int, boost::no_property>::sep_(boost::detail::adj_list_gen<boost::adjacency_list<boost::multisetS, boost::vecS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::setS>, boost::vecS, boost::multisetS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::setS>::config::vertex_descriptor&, std::set<boost::list_edge<long unsigned int, boost::no_property>, std::less<boost::list_edge<long unsigned int, boost::no_property> >, std::allocator<boost::list_edge<long unsigned int, boost::no_property> > >::iterator, boost::detail::adj_list_gen<boost::adjacency_list<boost::multisetS, boost::vecS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::setS>, boost::vecS, boost::multisetS, boost::directedS, boost::no_property, boost::no_property, boost::no_property, boost::setS>::config::EdgeContainer*)’
.../glnxa64/boost/include/boost/graph/detail/adjacency_list.hpp:1625:7:
note: candidates are:
In file included from .../glnxa64/boost/include/boost/graph/adjacency_list.hpp:370:0,
from sl_execgraph/Test.cpp:2:
.../glnxa64/boost/include/boost/graph/detail/adjacency_list.hpp:273:7: note: boost::detail::sep_<Vertex, Property>::sep_(const self&) [with Vertex = long unsigned int; Property = boost::no_property; boost::detail::sep_<Vertex, Property>::self = boost::detail::sep_<long unsigned int, boost::no_property>]
.../glnxa64/boost/include/boost/graph/detail/adjacency_list.hpp:273:7: note: candidate expects 1 argument, 3 provided
.../glnxa64/boost/include/boost/graph/detail/adjacency_list.hpp:270:14: note: boost::detail::sep_<Vertex, Property>::sep_(Vertex, const Property&) [with Vertex = long unsigned int; Property = boost::no_property]
.../glnxa64/boost/include/boost/graph/detail/adjacency_list.hpp:270:14: note: candidate expects 2 arguments, 3 provided
.../glnxa64/boost/include/boost/graph/detail/adjacency_list.hpp:269:14: note: boost::detail::sep_<Vertex, Property>::sep_() [with Vertex = long unsigned int; Property = boost::no_property]
.../glnxa64/boost/include/boost/graph/detail/adjacency_list.hpp:269:14: note: candidate expects 0 arguments, 3 provided
.../Makefile.module: recipe for target 'Test.o' failed