Utopia  2
Framework for studying models of complex & adaptive systems.
Enumerations | Functions
GraphIterators
Collaboration diagram for GraphIterators:

Enumerations

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

Functions

template<IterateOver iterate_over, typename Graph >
decltype(auto) Utopia::range (const Graph &g)
 Get the iterator range over selected graph entities. More...
 
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. More...
 

Detailed Description

Enumeration Type Documentation

◆ IterateOver

enum Utopia::IterateOver
strong

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.

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

◆ 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