template<typename _Graph>
GrAdaptor class
Graph adapter for Boost Graph Library integration.
| Template parameters | |
|---|---|
| _Graph | The Boost Graph Library graph type |
Provides a unified interface for working with BGL graphs, combining vertex and edge view functionality with additional graph operations.
Base classes
-
template<typename Graph>class VertexView<_Graph>
- Vertex view for Boost Graph Library graphs.
Public static functions
- static auto null_vertex() -> Vertex -> auto
- Get the null vertex descriptor.
Constructors, destructors, conversion operators
Public functions
- auto number_of_nodes() const -> auto
- Get the number of vertices in the graph.
- auto number_of_edges() const -> auto
- Get the number of edges in the graph.
- auto edges() const -> EdgeView< _Graph > -> auto
- Get an edge view for the graph.
- auto neighbors(Vertex v) const -> AtlasView< Vertex, _Graph > -> auto
- Get neighbors of a vertex.
- auto add_edge(int u, int v) -> auto
- Add an edge between two vertices.
-
template<typename Edge>auto source(const Edge& e) const -> Vertex -> auto
- Get the source vertex of an edge.
-
template<typename Edge>auto target(const Edge& e) const -> Vertex -> auto
- Get the target vertex of an edge.
-
template<typename Edge>auto end_points(const Edge& e) const -> auto
- Get the source and target vertices of an edge.
Function documentation
template<typename _Graph>
static auto py:: GrAdaptor<_Graph>:: null_vertex() -> Vertex
Get the null vertex descriptor.
| Returns | Vertex Null vertex descriptor |
|---|
Returns the special null vertex value used by the graph.
template<typename _Graph>
py:: GrAdaptor<_Graph>:: GrAdaptor() deleted
Default constructor (deleted)
Graph adaptor cannot be default constructed.
template<typename _Graph>
auto py:: GrAdaptor<_Graph>:: number_of_nodes() const
Get the number of vertices in the graph.
| Returns | Number of vertices |
|---|
template<typename _Graph>
auto py:: GrAdaptor<_Graph>:: number_of_edges() const
Get the number of edges in the graph.
| Returns | Number of edges |
|---|
template<typename _Graph>
auto py:: GrAdaptor<_Graph>:: edges() const -> EdgeView< _Graph >
Get an edge view for the graph.
| Returns | EdgeView<_Graph> Iterable edge view |
|---|
Returns an iterable view of all edges in the graph.
template<typename _Graph>
auto py:: GrAdaptor<_Graph>:: neighbors(Vertex v) const -> AtlasView< Vertex, _Graph >
Get neighbors of a vertex.
| Parameters | |
|---|---|
| v in | The vertex to get neighbors for |
| Returns | AtlasView<Vertex, _Graph> Iterable view of adjacent edges |
Returns an iterable view of edges adjacent to the specified vertex.
template<typename _Graph>
auto py:: GrAdaptor<_Graph>:: add_edge(int u,
int v)
Add an edge between two vertices.
| Parameters | |
|---|---|
| u in | Source vertex index |
| v in | Target vertex index |
| Returns | auto Edge descriptor of the newly added edge |
template<typename _Graph>
template<typename Edge>
auto py:: GrAdaptor<_Graph>:: source(const Edge& e) const -> Vertex
Get the source vertex of an edge.
| Template parameters | |
|---|---|
| Edge | The edge descriptor type |
| Parameters | |
| e in | The edge to get the source of |
| Returns | Vertex Source vertex of the edge |
Returns the source (origin) vertex of the specified edge.
template<typename _Graph>
template<typename Edge>
auto py:: GrAdaptor<_Graph>:: target(const Edge& e) const -> Vertex
Get the target vertex of an edge.
| Template parameters | |
|---|---|
| Edge | The edge descriptor type |
| Parameters | |
| e in | The edge to get the target of |
| Returns | Vertex Target vertex of the edge |
Returns the target (destination) vertex of the specified edge.
template<typename _Graph>
template<typename Edge>
auto py:: GrAdaptor<_Graph>:: end_points(const Edge& e) const
Get the source and target vertices of an edge.
| Template parameters | |
|---|---|
| Edge | The edge descriptor type |
| Parameters | |
| e in | The edge |
| Returns | std::pair<Vertex, Vertex> Pair of (source, target) vertices |