Utopia 2
Framework for studying models of complex & adaptive systems.
Loading...
Searching...
No Matches
Namespaces | Enumerations | Functions
GraphIterators
Collaboration diagram for GraphIterators:

Namespaces

namespace  Utopia::GraphUtils
 

Enumerations

enum class  Utopia::IterateOver {
  Utopia::IterateOver::vertices , Utopia::IterateOver::edges , Utopia::IterateOver::neighbors , Utopia::IterateOver::inv_neighbors ,
  Utopia::IterateOver::in_edges , Utopia::IterateOver::out_edges
}
 Over which graph entity to iterate. More...
 

Functions

template<IterateOver iterate_over, typename Graph >
decltype(autoUtopia::range (const Graph &g)
 Get the iterator range over selected graph entities.
 
template<IterateOver iterate_over, typename Graph , typename EntityDesc >
decltype(autoUtopia::range (EntityDesc e, const Graph &g)
 Get the iterator range over selected graph entities.
 

Detailed Description

Enumeration Type Documentation

◆ IterateOver

Over which graph entity to iterate.

Enumerator
vertices 

Iterate over vertices.

edges 

Iterate over edges.

neighbors 

Iterate over neighbors (adjacent_vertices).

This iteration requires a vertex descriptor whose neighbors to iterate over.

inv_neighbors 

Iterate inversely over neighbors (adjacent_vertices).

This iteration requires a vertex descriptor whose neighbors to iterate over.

in_edges 

Iterate over the in edges of a vertex.

This iteration requires a vertex descriptor whose neighbors to iterate over.

out_edges 

Iterate over the out edges of a vertex.

This iteration requires a vertex descriptor whose neighbors to iterate over.

19 {
22
24 edges,
25
27
31
33
37
39
43
45
49};
@ 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.

Function Documentation

◆ range() [1/2]

template<IterateOver iterate_over, typename Graph >
decltype(auto) Utopia::range ( const Graph &  g)

Get the iterator range over selected graph entities.

Template Parameters
iterate_overSpecify over which graph entities to iterate over Valid options:
GraphThe graph type
Parameters
gThe graph
Returns
decltype(auto) The iterator range
149 {
150 return boost::make_iterator_range(
151 GraphUtils::iterator_pair<iterate_over>(g));
152}

◆ range() [2/2]

template<IterateOver iterate_over, typename Graph , typename EntityDesc >
decltype(auto) Utopia::range ( EntityDesc  e,
const Graph &  g 
)

Get the iterator range over selected graph entities.

This function returns the iterator range wrt. another graph entity. For example iterating of the neighbors (adjacent_vertices) of a vertex requires a vertex descriptor as reference.

Template Parameters
iterate_overSpecify over which graph entities to iterate over Valid options:
GraphThe graph type
EntityDescThe graph entity descriptor that is the reference point for the iteration.
Parameters
eThe graph entity that serves as reference
gThe graph
Returns
decltype(auto) The iterator range
177 {
178 return boost::make_iterator_range(
179 GraphUtils::iterator_pair<iterate_over>(e, g));
180}