Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::labeled_graph< Graph, Label, Selector > Class Template Reference

The labeled_graph class is a graph adaptor that maintains a mapping between vertex labels and vertex descriptors. More...

#include <labeled_graph.hpp>

Inheritance diagram for boost::labeled_graph< Graph, Label, Selector >:
Collaboration diagram for boost::labeled_graph< Graph, Label, Selector >:

Public Types

typedef labeled_graph_class_tag graph_tag
 
typedef Base::graph_type graph_type
 
typedef graph_traits
< graph_type >
::vertex_descriptor 
vertex_descriptor
 
typedef graph_traits
< graph_type >
::edge_descriptor 
edge_descriptor
 
typedef graph_traits
< graph_type >
::directed_category 
directed_category
 
typedef graph_traits
< graph_type >
::edge_parallel_category 
edge_parallel_category
 
typedef graph_traits
< graph_type >
::traversal_category 
traversal_category
 
typedef graph_traits
< graph_type >
::out_edge_iterator 
out_edge_iterator
 
typedef graph_traits
< graph_type >
::in_edge_iterator 
in_edge_iterator
 
typedef graph_traits
< graph_type >
::adjacency_iterator 
adjacency_iterator
 
typedef graph_traits
< graph_type >
::degree_size_type 
degree_size_type
 
typedef graph_traits
< graph_type >
::vertex_iterator 
vertex_iterator
 
typedef graph_traits
< graph_type >
::vertices_size_type 
vertices_size_type
 
typedef graph_traits
< graph_type >::edge_iterator 
edge_iterator
 
typedef graph_traits
< graph_type >
::edges_size_type 
edges_size_type
 
typedef
graph_type::graph_property_type 
graph_property_type
 
typedef graph_type::graph_bundled graph_bundled
 
typedef
graph_type::vertex_property_type 
vertex_property_type
 
typedef graph_type::vertex_bundled vertex_bundled
 
typedef
graph_type::edge_property_type 
edge_property_type
 
typedef graph_type::edge_bundled edge_bundled
 
typedef Base::label_type label_type
 
typedef Base::map_type map_type
 

Public Member Functions

 labeled_graph (graph_property_type const &gp=graph_property_type())
 
 labeled_graph (labeled_graph const &x)
 
 labeled_graph (vertices_size_type n, graph_property_type const &gp=graph_property_type())
 
template<typename LabelIter >
 labeled_graph (vertices_size_type n, LabelIter l, graph_property_type const &gp=graph_property_type())
 
template<typename LabelIter , typename PropIter >
 labeled_graph (vertices_size_type n, LabelIter l, PropIter p, graph_property_type const &gp=graph_property_type())
 
labeled_graphoperator= (labeled_graph const &x)
 
bool label_vertex (vertex_descriptor v, Label const &l)
 Create a new label for the given vertex, returning false, if the label cannot be created. More...
 
void remove_vertex (Label const &l)
 Remove the vertex with the given label. More...
 
vertex_descriptor vertex (Label const &l) const
 Return a descriptor for the given label. More...
 
Graph Accessors
graph_typegraph ()
 
graph_type const & graph () const
 
Add Vertex

Add a vertex to the graph, returning the descriptor.

If the vertices are uniquely labeled and the label already exists within the graph, then no vertex is added, and the returned descriptor refers to the existing vertex. A vertex property can be given as a parameter, if needed.

vertex_descriptor add_vertex (Label const &l)
 
vertex_descriptor add_vertex (Label const &l, vertex_property_type const &p)
 
Insert Vertex

Insert a vertex into the graph, returning a pair containing the descriptor of a vertex and a boolean value that describes whether or not a new vertex was inserted.

If vertices are not uniquely labeled, then insertion will always succeed.

std::pair< vertex_descriptor,
bool > 
insert_vertex (Label const &l)
 
std::pair< vertex_descriptor,
bool > 
insert_vertex (Label const &l, vertex_property_type const &p)
 
Bundled Properties
vertex_bundledoperator[] (Label const &l)
 
vertex_bundled const & operator[] (Label const &l) const
 
edge_bundledoperator[] (edge_descriptor e)
 
edge_bundled const & operator[] (edge_descriptor e) const
 

Static Public Member Functions

static vertex_descriptor null_vertex ()
 Return a null descriptor. More...
 

Detailed Description

template<typename Graph, typename Label, typename Selector = defaultS>
class boost::labeled_graph< Graph, Label, Selector >

The labeled_graph class is a graph adaptor that maintains a mapping between vertex labels and vertex descriptors.

Todo:
This class is somewhat redundant for adjacency_list<*, vecS> if the intended label is an unsigned int (and perhaps some other cases), but it does avoid some weird ambiguities (i.e. adding a vertex with a label that does not match its target index).
Todo:
This needs to be reconciled with the named_graph, but since there is no documentation or examples, its not going to happen.

Member Typedef Documentation

template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::adjacency_iterator boost::labeled_graph< Graph, Label, Selector >::adjacency_iterator
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::degree_size_type boost::labeled_graph< Graph, Label, Selector >::degree_size_type
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::directed_category boost::labeled_graph< Graph, Label, Selector >::directed_category
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_type::edge_bundled boost::labeled_graph< Graph, Label, Selector >::edge_bundled
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::edge_descriptor boost::labeled_graph< Graph, Label, Selector >::edge_descriptor
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::edge_iterator boost::labeled_graph< Graph, Label, Selector >::edge_iterator
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::edge_parallel_category boost::labeled_graph< Graph, Label, Selector >::edge_parallel_category
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_type::edge_property_type boost::labeled_graph< Graph, Label, Selector >::edge_property_type
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::edges_size_type boost::labeled_graph< Graph, Label, Selector >::edges_size_type
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_type::graph_bundled boost::labeled_graph< Graph, Label, Selector >::graph_bundled
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_type::graph_property_type boost::labeled_graph< Graph, Label, Selector >::graph_property_type
template<typename Graph, typename Label, typename Selector = defaultS>
typedef labeled_graph_class_tag boost::labeled_graph< Graph, Label, Selector >::graph_tag
template<typename Graph, typename Label, typename Selector = defaultS>
typedef Base::graph_type boost::labeled_graph< Graph, Label, Selector >::graph_type
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::in_edge_iterator boost::labeled_graph< Graph, Label, Selector >::in_edge_iterator
template<typename Graph, typename Label, typename Selector = defaultS>
typedef Base::label_type boost::labeled_graph< Graph, Label, Selector >::label_type
template<typename Graph, typename Label, typename Selector = defaultS>
typedef Base::map_type boost::labeled_graph< Graph, Label, Selector >::map_type
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::out_edge_iterator boost::labeled_graph< Graph, Label, Selector >::out_edge_iterator
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::traversal_category boost::labeled_graph< Graph, Label, Selector >::traversal_category
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_type::vertex_bundled boost::labeled_graph< Graph, Label, Selector >::vertex_bundled
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::vertex_descriptor boost::labeled_graph< Graph, Label, Selector >::vertex_descriptor
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::vertex_iterator boost::labeled_graph< Graph, Label, Selector >::vertex_iterator
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_type::vertex_property_type boost::labeled_graph< Graph, Label, Selector >::vertex_property_type
template<typename Graph, typename Label, typename Selector = defaultS>
typedef graph_traits<graph_type>::vertices_size_type boost::labeled_graph< Graph, Label, Selector >::vertices_size_type

Constructor & Destructor Documentation

template<typename Graph, typename Label, typename Selector = defaultS>
boost::labeled_graph< Graph, Label, Selector >::labeled_graph ( graph_property_type const &  gp = graph_property_type())
inline
template<typename Graph, typename Label, typename Selector = defaultS>
boost::labeled_graph< Graph, Label, Selector >::labeled_graph ( labeled_graph< Graph, Label, Selector > const &  x)
inline
template<typename Graph, typename Label, typename Selector = defaultS>
boost::labeled_graph< Graph, Label, Selector >::labeled_graph ( vertices_size_type  n,
graph_property_type const &  gp = graph_property_type() 
)
inline

References boost::vertices().

template<typename Graph, typename Label, typename Selector = defaultS>
template<typename LabelIter >
boost::labeled_graph< Graph, Label, Selector >::labeled_graph ( vertices_size_type  n,
LabelIter  l,
graph_property_type const &  gp = graph_property_type() 
)
inline
template<typename Graph, typename Label, typename Selector = defaultS>
template<typename LabelIter , typename PropIter >
boost::labeled_graph< Graph, Label, Selector >::labeled_graph ( vertices_size_type  n,
LabelIter  l,
PropIter  p,
graph_property_type const &  gp = graph_property_type() 
)
inline

Member Function Documentation

template<typename Graph, typename Label, typename Selector = defaultS>
vertex_descriptor boost::labeled_graph< Graph, Label, Selector >::add_vertex ( Label const &  l)
inline
template<typename Graph, typename Label, typename Selector = defaultS>
vertex_descriptor boost::labeled_graph< Graph, Label, Selector >::add_vertex ( Label const &  l,
vertex_property_type const &  p 
)
inline
template<typename Graph, typename Label, typename Selector = defaultS>
graph_type& boost::labeled_graph< Graph, Label, Selector >::graph ( )
inline
template<typename Graph, typename Label, typename Selector = defaultS>
graph_type const& boost::labeled_graph< Graph, Label, Selector >::graph ( ) const
inline
template<typename Graph, typename Label, typename Selector = defaultS>
std::pair<vertex_descriptor, bool> boost::labeled_graph< Graph, Label, Selector >::insert_vertex ( Label const &  l)
inline
template<typename Graph, typename Label, typename Selector = defaultS>
std::pair<vertex_descriptor, bool> boost::labeled_graph< Graph, Label, Selector >::insert_vertex ( Label const &  l,
vertex_property_type const &  p 
)
inline
template<typename Graph, typename Label, typename Selector = defaultS>
bool boost::labeled_graph< Graph, Label, Selector >::label_vertex ( vertex_descriptor  v,
Label const &  l 
)
inline

Create a new label for the given vertex, returning false, if the label cannot be created.

References boost::graph_detail::put_vertex_label().

template<typename Graph, typename Label, typename Selector = defaultS>
static vertex_descriptor boost::labeled_graph< Graph, Label, Selector >::null_vertex ( )
inlinestatic

Return a null descriptor.

template<typename Graph, typename Label, typename Selector = defaultS>
labeled_graph& boost::labeled_graph< Graph, Label, Selector >::operator= ( labeled_graph< Graph, Label, Selector > const &  x)
inline
template<typename Graph, typename Label, typename Selector = defaultS>
vertex_bundled& boost::labeled_graph< Graph, Label, Selector >::operator[] ( Label const &  l)
inline
template<typename Graph, typename Label, typename Selector = defaultS>
vertex_bundled const& boost::labeled_graph< Graph, Label, Selector >::operator[] ( Label const &  l) const
inline
template<typename Graph, typename Label, typename Selector = defaultS>
edge_bundled& boost::labeled_graph< Graph, Label, Selector >::operator[] ( edge_descriptor  e)
inline
template<typename Graph, typename Label, typename Selector = defaultS>
edge_bundled const& boost::labeled_graph< Graph, Label, Selector >::operator[] ( edge_descriptor  e) const
inline
template<typename Graph, typename Label, typename Selector = defaultS>
void boost::labeled_graph< Graph, Label, Selector >::remove_vertex ( Label const &  l)
inline

Remove the vertex with the given label.

References boost::remove_vertex(), and boost::labeled_graph< Graph, Label, Selector >::vertex().

template<typename Graph, typename Label, typename Selector = defaultS>
vertex_descriptor boost::labeled_graph< Graph, Label, Selector >::vertex ( Label const &  l) const
inline

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