1 #ifndef UTOPIA_CORE_GRAPH_ITERATORS_HH
2 #define UTOPIA_CORE_GRAPH_ITERATORS_HH
4 #include <boost/graph/adjacency_list.hpp>
5 #include <boost/graph/adjacency_matrix.hpp>
6 #include <boost/graph/subgraph.hpp>
7 #include <boost/graph/filtered_graph.hpp>
67 template<IterateOver iterate_over,
typename Graph>
69 using namespace boost;
80 "Only the iterator pairs of vertices and edges can be"
81 "returned: iterate_over is set wrong!");
106 template<IterateOver iterate_over,
typename Graph,
typename EntityDesc>
108 using namespace boost;
111 return adjacent_vertices(e, g);
114 return inv_adjacent_vertices(e, g);
127 "Only the iterator pairs of neighbors, inv_neighbors, "
128 "in_edge, and out_edge can be returned: "
129 "iterate_over is set wrong!");
148 template<IterateOver iterate_over,
typename Graph>
149 decltype(
auto)
range(const Graph& g){
150 return boost::make_iterator_range(
151 GraphUtils::iterator_pair<iterate_over>(g));
176 template<IterateOver iterate_over,
typename Graph,
typename EntityDesc>
177 decltype(
auto)
range(EntityDesc e, const Graph& g){
178 return boost::make_iterator_range(
179 GraphUtils::iterator_pair<iterate_over>(e, g));
IterateOver
Over which graph entity to iterate.
Definition: iterator.hh:19
decltype(auto) range(const Graph &g)
Get the iterator range over selected graph entities.
Definition: iterator.hh:149
@ in_edges
Iterate over the in edges of a vertex.
@ out_edges
Iterate over the out edges of a vertex.
@ neighbors
Iterate over neighbors (adjacent_vertices).
@ inv_neighbors
Iterate inversely over neighbors (adjacent_vertices).
@ vertices
Iterate over vertices.
@ edges
Iterate over edges.
decltype(auto) iterator_pair(const Graph &g)
Get an iterator pair over selected graph entities.
Definition: iterator.hh:68