STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Protected Attributes
stapl::sequential::bgl_graph< BGL_Graph > Class Template Reference

Core graph implementation based on BGL. More...

Public Member Functions

 bgl_graph (size_t _nv=0)
 Constructs a graph with a specific number of vertices. More...
 
vertex_iterator begin ()
 Returns an iterator referring to the first vertex of the graph.
 
const_vertex_iterator begin () const
 Returns an iterator referring to the first vertex of the graph. More...
 
vertex_iterator end ()
 Returns an iterator referring to the past-the-end vertex of the graph.
 
const_vertex_iterator end () const
 Returns an iterator referring to the past-the-end vertex of the graph. More...
 
edge_iterator edges_begin ()
 Returns an iterator referring to the first edge of the graph.
 
const_edge_iterator edges_begin () const
 Returns an iterator referring to the first edge of the graph. More...
 
edge_iterator edges_end ()
 Returns an iterator referring to the past-the-end edge of the graph.
 
const_edge_iterator edges_end () const
 Returns an iterator referring to the past-the-end edge of the graph. More...
 
size_t get_num_vertices () const
 Returns the number of vertices of the graph.
 
void update_descriptor (size_t &, const vertex_iterator)
 Update a descriptor. More...
 
size_t get_max_descriptor () const
 Returns the id of the last descriptor.
 
size_t get_num_edges () const
 Returns the number of edges of the graph.
 
vertex_descriptor add_vertex (void)
 Adds a new vertex to the graph. More...
 
vertex_descriptor add_vertex (vertex_property &_vp)
 Adds a new vertex with properties to the graph. More...
 
edge_descriptor add_edge (const edge_descriptor &_ed)
 Adds a new edge to the graph. More...
 
edge_descriptor add_edge (const edge_descriptor &_ed, const edge_property &_p)
 Adds a new edge with a specific descriptor and property to the graph. More...
 
void clear (void)
 Clears the entire graph.
 
bool delete_vertex (const vertex_descriptor &_vd)
 Deletes a vertex with a specific descriptor from the graph. More...
 
bool delete_edge (const edge_descriptor &_ed)
 Deletes a edge with a specific descriptor from the graph. More...
 
bool find_edge (const edge_descriptor &_ed, vertex_iterator &_vi, adj_edge_iterator &_ei)
 Finds a edge with a specific descriptor from the graph. More...
 
bool find_edge (const edge_descriptor &_ed, const_vertex_iterator &_vi, const_adj_edge_iterator &_ei) const
 Finds a edge with a specific descriptor from the graph. More...
 
const_vertex_iterator find_vertex (const vertex_descriptor &_vd) const
 Finds a vertex with a given vertex descriptor. More...
 
vertex_iterator find_vertex (const vertex_descriptor &_vd)
 Finds a vertex with a given vertex descriptor. More...
 

Public Types

typedef boost::graph_traits< graph_t >::vertex_descriptor vertex_descriptor
 
typedef bgl_edge_descriptor_adaptor< graph_t > edge_descriptor
 
typedef boost::property_map< graph_t, boost::vertex_user_property_t >::type::value_type vertex_property
 
typedef boost::property_map< graph_t, boost::edge_weight_t >::type::value_type edge_property
 
typedef vertex_descriptor_generator< size_t > vdg_type
 
typedef bgl_vertex_iterator_adaptor< bgl_vertex_iterator, graph_t > vertex_iterator
 
typedef const_bgl_vertex_iterator_adaptor< bgl_vertex_iterator, graph_t > const_vertex_iterator
 
typedef bgl_edge_iterator_adaptor< bgl_edge_iterator, graph_t > edge_iterator
 
typedef const_bgl_edge_iterator_adaptor< bgl_edge_iterator, graph_t > const_edge_iterator
 
typedef bgl_edge_iterator_adaptor< bgl_out_edge_iterator, graph_t > adj_edge_iterator
 
typedef const_bgl_edge_iterator_adaptor< bgl_out_edge_iterator, graph_t > const_adj_edge_iterator
 

Protected Attributes

graph_t m_bgl_graph
 
vdg_type m_vdg
 
size_t m_edge_id
 

Detailed Description

template<class BGL_Graph>
class stapl::sequential::bgl_graph< BGL_Graph >

Core graph implementation based on BGL.

Template Parameters
BGL_GraphType of the boost graph.

Constructor & Destructor Documentation

◆ bgl_graph()

template<class BGL_Graph >
stapl::sequential::bgl_graph< BGL_Graph >::bgl_graph ( size_t  _nv = 0)

Constructs a graph with a specific number of vertices.

Parameters
_nvThe number of vertices to be created. By default a new graph with 0 vertices will be created.

Member Function Documentation

◆ begin()

template<class BGL_Graph >
const_vertex_iterator stapl::sequential::bgl_graph< BGL_Graph >::begin ( void  ) const

Returns an iterator referring to the first vertex of the graph.

◆ end()

template<class BGL_Graph >
const_vertex_iterator stapl::sequential::bgl_graph< BGL_Graph >::end ( void  ) const

Returns an iterator referring to the past-the-end vertex of the graph.

◆ edges_begin()

template<class BGL_Graph >
const_edge_iterator stapl::sequential::bgl_graph< BGL_Graph >::edges_begin ( void  ) const

Returns an iterator referring to the first edge of the graph.

◆ edges_end()

template<class BGL_Graph >
const_edge_iterator stapl::sequential::bgl_graph< BGL_Graph >::edges_end ( void  ) const

Returns an iterator referring to the past-the-end edge of the graph.

◆ update_descriptor()

template<class BGL_Graph >
void stapl::sequential::bgl_graph< BGL_Graph >::update_descriptor ( size_t &  ,
const vertex_iterator   
)

Update a descriptor.

◆ add_vertex() [1/2]

template<class BGL_Graph >
vertex_descriptor stapl::sequential::bgl_graph< BGL_Graph >::add_vertex ( void  )

Adds a new vertex to the graph.

Returns
The vertex descriptor of the new vertex.

◆ add_vertex() [2/2]

template<class BGL_Graph >
vertex_descriptor stapl::sequential::bgl_graph< BGL_Graph >::add_vertex ( vertex_property &  _vp)

Adds a new vertex with properties to the graph.

Parameters
_vpThe vertex property of the newly created vertex.
Returns
The vertex descriptor of the new vertex.

◆ add_edge() [1/2]

template<class BGL_Graph >
edge_descriptor stapl::sequential::bgl_graph< BGL_Graph >::add_edge ( const edge_descriptor _ed)

Adds a new edge to the graph.

Returns
The edge descriptor of the new edge.

◆ add_edge() [2/2]

template<class BGL_Graph >
edge_descriptor stapl::sequential::bgl_graph< BGL_Graph >::add_edge ( const edge_descriptor _ed,
const edge_property &  _p 
)

Adds a new edge with a specific descriptor and property to the graph.

Parameters
_edThe descriptor of the new edge
_pThe property of the edge.
Returns
The edge descriptor of the new edge.

◆ delete_vertex()

template<class BGL_Graph >
bool stapl::sequential::bgl_graph< BGL_Graph >::delete_vertex ( const vertex_descriptor &  _vd)

Deletes a vertex with a specific descriptor from the graph.

Parameters
_vdThe descriptor of the vertex to be deleted.
Returns
A bool value that indicates whether the vertex was sucessfully deleted or not.

◆ delete_edge()

template<class BGL_Graph >
bool stapl::sequential::bgl_graph< BGL_Graph >::delete_edge ( const edge_descriptor _ed)

Deletes a edge with a specific descriptor from the graph.

Parameters
_edThe descriptor of the edge to be deleted.
Returns
A bool value that indicates whether the edge was sucessfully deleted or not.

◆ find_edge() [1/2]

template<class BGL_Graph >
bool stapl::sequential::bgl_graph< BGL_Graph >::find_edge ( const edge_descriptor _ed,
vertex_iterator _vi,
adj_edge_iterator _ei 
)

Finds a edge with a specific descriptor from the graph.

Parameters
_edThe descriptor of the searched edge.
_viIf the edge is found, _vi will refer to the source vertex of that edge. Otherwise it will point to the graph past-to-end vertex.
_eiIf the edge is found, This iterator will point to the edge.
Returns
A bool value that indicates whether the edge was sucessfully found or not.

◆ find_edge() [2/2]

template<class BGL_Graph >
bool stapl::sequential::bgl_graph< BGL_Graph >::find_edge ( const edge_descriptor _ed,
const_vertex_iterator _vi,
const_adj_edge_iterator _ei 
) const

Finds a edge with a specific descriptor from the graph.

Parameters
_edThe descriptor of the searched edge.
_viIf the edge is found, _vi will refer to the source vertex of that edge. Otherwise it will point to the graph past-to-end vertex.
_eiIf the edge is found, This iterator will point to the edge.
Returns
A bool value that indicates whether the edge was sucessfully found or not.

◆ find_vertex() [1/2]

template<class BGL_Graph >
const_vertex_iterator stapl::sequential::bgl_graph< BGL_Graph >::find_vertex ( const vertex_descriptor &  _vd) const

Finds a vertex with a given vertex descriptor.

Parameters
_vdThe vertex descriptor
Returns
An iterator pointing to the corresponding vertex. If no vertex was found, the iterator points to past-the-end element

◆ find_vertex() [2/2]

template<class BGL_Graph >
vertex_iterator stapl::sequential::bgl_graph< BGL_Graph >::find_vertex ( const vertex_descriptor &  _vd)

Finds a vertex with a given vertex descriptor.

Parameters
_vdThe vertex descriptor
Returns
An iterator pointing to the corresponding vertex. If no vertex was found, the iterator points to past-the-end element

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