Py2Cpp 1.6.3; VERSION ${PROJECT_VERSION}
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
py::GrAdaptor< _Graph > Class Template Reference

Graph adapter for Boost Graph Library integration. More...

#include <nx2bgl.hpp>

Inheritance diagram for py::GrAdaptor< _Graph >:
Inheritance graph
[legend]
Collaboration diagram for py::GrAdaptor< _Graph >:
Collaboration graph
[legend]

Public Types

using Vertex = typename boost::graph_traits< _Graph >::vertex_descriptor
 
using node_t = Vertex
 
using edge_t = typename boost::graph_traits< _Graph >::edge_descriptor
 

Public Member Functions

 GrAdaptor ()=delete
 Default constructor (deleted)
 
 GrAdaptor (_Graph &&gra) noexcept
 Construct a new graph adaptor object.
 
auto number_of_nodes () const
 Get the number of vertices in the graph.
 
auto number_of_edges () const
 Get the number of edges in the graph.
 
auto edges () const -> EdgeView< _Graph >
 Get an edge view for the graph.
 
auto neighbors (Vertex v) const -> AtlasView< Vertex, _Graph >
 Get neighbors of a vertex.
 
auto add_edge (int u, int v)
 Add an edge between two vertices.
 
template<typename Edge >
auto source (const Edge &e) const -> Vertex
 Get the source vertex of an edge.
 
template<typename Edge >
auto target (const Edge &e) const -> Vertex
 Get the target vertex of an edge.
 
template<typename Edge >
auto end_points (const Edge &e) const
 Get the source and target vertices of an edge.
 
- Public Member Functions inherited from py::VertexView< _Graph >
 VertexView (_Graph &&gra) noexcept
 Construct a new Vertex View object.
 
auto begin () const
 Get iterator to the beginning of vertices.
 
auto end () const
 Get iterator to the end of vertices.
 
auto cbegin () const
 Get const iterator to the beginning of vertices.
 
auto cend () const
 Get const iterator to the end of vertices.
 

Static Public Member Functions

static auto null_vertex () -> Vertex
 Get the null vertex descriptor.
 

Detailed Description

template<typename _Graph>
class py::GrAdaptor< _Graph >

Graph adapter for Boost Graph Library integration.

Provides a unified interface for working with BGL graphs, combining vertex and edge view functionality with additional graph operations.

Template Parameters
_GraphThe Boost Graph Library graph type

Member Typedef Documentation

◆ edge_t

template<typename _Graph >
using py::GrAdaptor< _Graph >::edge_t = typename boost::graph_traits<_Graph>::edge_descriptor

◆ node_t

template<typename _Graph >
using py::GrAdaptor< _Graph >::node_t = Vertex

◆ Vertex

template<typename _Graph >
using py::GrAdaptor< _Graph >::Vertex = typename boost::graph_traits<_Graph>::vertex_descriptor

Constructor & Destructor Documentation

◆ GrAdaptor() [1/2]

template<typename _Graph >
py::GrAdaptor< _Graph >::GrAdaptor ( )
delete

Default constructor (deleted)

Graph adaptor cannot be default constructed.

◆ GrAdaptor() [2/2]

template<typename _Graph >
py::GrAdaptor< _Graph >::GrAdaptor ( _Graph &&  gra)
inlineexplicitnoexcept

Construct a new graph adaptor object.

Creates a graph adaptor by moving an existing graph into this wrapper.

Parameters
[in]graThe graph to wrap (moved into this GrAdaptor)

Member Function Documentation

◆ add_edge()

template<typename _Graph >
auto py::GrAdaptor< _Graph >::add_edge ( int  u,
int  v 
)
inline

Add an edge between two vertices.

Parameters
[in]uSource vertex index
[in]vTarget vertex index
Returns
auto Edge descriptor of the newly added edge

◆ edges()

template<typename _Graph >
auto py::GrAdaptor< _Graph >::edges ( ) const -> EdgeView<_Graph>
inline

Get an edge view for the graph.

Returns an iterable view of all edges in the graph.

Returns
EdgeView<_Graph> Iterable edge view

◆ end_points()

template<typename _Graph >
template<typename Edge >
auto py::GrAdaptor< _Graph >::end_points ( const Edge &  e) const
inline

Get the source and target vertices of an edge.

Template Parameters
EdgeThe edge descriptor type
Parameters
[in]eThe edge
Returns
std::pair<Vertex, Vertex> Pair of (source, target) vertices

◆ neighbors()

template<typename _Graph >
auto py::GrAdaptor< _Graph >::neighbors ( Vertex  v) const -> AtlasView<Vertex, _Graph>
inline

Get neighbors of a vertex.

Returns an iterable view of edges adjacent to the specified vertex.

Parameters
[in]vThe vertex to get neighbors for
Returns
AtlasView<Vertex, _Graph> Iterable view of adjacent edges

◆ null_vertex()

template<typename _Graph >
static auto py::GrAdaptor< _Graph >::null_vertex ( ) -> Vertex
inlinestatic

Get the null vertex descriptor.

Returns the special null vertex value used by the graph.

Returns
Vertex Null vertex descriptor

◆ number_of_edges()

template<typename _Graph >
auto py::GrAdaptor< _Graph >::number_of_edges ( ) const
inline

Get the number of edges in the graph.

Returns
Number of edges

◆ number_of_nodes()

template<typename _Graph >
auto py::GrAdaptor< _Graph >::number_of_nodes ( ) const
inline

Get the number of vertices in the graph.

Returns
Number of vertices

◆ source()

template<typename _Graph >
template<typename Edge >
auto py::GrAdaptor< _Graph >::source ( const Edge &  e) const -> Vertex
inline

Get the source vertex of an edge.

Returns the source (origin) vertex of the specified edge.

Template Parameters
EdgeThe edge descriptor type
Parameters
[in]eThe edge to get the source of
Returns
Vertex Source vertex of the edge

◆ target()

template<typename _Graph >
template<typename Edge >
auto py::GrAdaptor< _Graph >::target ( const Edge &  e) const -> Vertex
inline

Get the target vertex of an edge.

Returns the target (destination) vertex of the specified edge.

Template Parameters
EdgeThe edge descriptor type
Parameters
[in]eThe edge to get the target of
Returns
Vertex Target vertex of the edge

The documentation for this class was generated from the following file: