ROSE  0.9.10.2
Public Member Functions | List of all members
Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex Class Reference

Description

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
class Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex

Vertex node.

These list nodes contain all information about a vertex and are the objects returned (by reference) when a vertex node iterator (VertexIterator or ConstVertexIterator) is dereferenced.

Definition at line 1176 of file Graph.h.

#include <Graph.h>

Public Member Functions

const size_t & id () const
 Unique vertex ID number. More...
 
size_t nInEdges () const
 Number of incoming edges. More...
 
size_t nOutEdges () const
 Number of outgoing edges. More...
 
size_t degree () const
 Number of incident edges. More...
 
boost::iterator_range
< EdgeIterator
inEdges ()
 List of incoming edges. More...
 
boost::iterator_range
< ConstEdgeIterator
inEdges () const
 List of incoming edges. More...
 
boost::iterator_range
< EdgeIterator
outEdges ()
 List of outgoing edges. More...
 
boost::iterator_range
< ConstEdgeIterator
outEdges () const
 List of outgoing edges. More...
 
VertexValuevalue ()
 User-defined value. More...
 
const VertexValuevalue () const
 User-defined value. More...
 

Member Function Documentation

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
const size_t& Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex::id ( ) const
inline

Unique vertex ID number.

Vertices within a graph are numbered consecutively starting at zero, and this method returns the vertex's ID number. ID numbers are unrelated to the order in which vertices are inserted, although in the absense of vertex erasure they will be assigned consecutively. Vertex ID numbers are stable over insertion of vertices and edges and the erasure of edges, but are not stable over vertex erasure. In order to obtain constant-time vertex erasure (at least when it has no incident edges), after a vertex is erased the largest-ID vertex is renumbered to fill the gap.

Time complexity is constant.

Definition at line 1196 of file Graph.h.

Referenced by Sawyer::Container::Algorithm::graphCopySubgraph(), Sawyer::Container::Algorithm::graphFindConnectedComponents(), Sawyer::Container::Algorithm::graphIsConnected(), and Sawyer::Container::Graph< AbstractLocation, DataFlowEdge >::operator=().

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
boost::iterator_range<EdgeIterator> Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex::inEdges ( )
inline

List of incoming edges.

Returns a sublist of edges whose target vertex is this vertex. The return value is a pair of iterators which delineate the edges. The traversal is in no particular order. Edge iterators are equality-comparable with one another even when the come from different sublists. See EdgeIterator for details.

Time complexity is constant.

Definition at line 1207 of file Graph.h.

Referenced by Sawyer::Container::Algorithm::graphFindConnectedComponents(), and Sawyer::Container::Algorithm::graphIsConnected().

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
boost::iterator_range<ConstEdgeIterator> Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex::inEdges ( ) const
inline

List of incoming edges.

Returns a sublist of edges whose target vertex is this vertex. The return value is a pair of iterators which delineate the edges. The traversal is in no particular order. Edge iterators are equality-comparable with one another even when the come from different sublists. See EdgeIterator for details.

Time complexity is constant.

Definition at line 1212 of file Graph.h.

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
boost::iterator_range<EdgeIterator> Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex::outEdges ( )
inline

List of outgoing edges.

Returns a sublist of edges whose source vertex is this vertex. The return value is a pair of iterators which delineate the edges. The traversal is in no particular order. Edge iterators are equality-comparable with one another even when the come from different sublists. See EdgeIterator for details.

Time complexity is constant.

Definition at line 1228 of file Graph.h.

Referenced by Sawyer::Container::Algorithm::graphCopySubgraph(), Sawyer::Container::Algorithm::graphEraseParallelEdges(), Sawyer::Container::Algorithm::graphFindConnectedComponents(), and Sawyer::Container::Algorithm::graphIsConnected().

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
boost::iterator_range<ConstEdgeIterator> Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex::outEdges ( ) const
inline

List of outgoing edges.

Returns a sublist of edges whose source vertex is this vertex. The return value is a pair of iterators which delineate the edges. The traversal is in no particular order. Edge iterators are equality-comparable with one another even when the come from different sublists. See EdgeIterator for details.

Time complexity is constant.

Definition at line 1233 of file Graph.h.

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
size_t Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex::nInEdges ( ) const
inline

Number of incoming edges.

Returns the in-degree of this vertex, the length of the list returned by inEdges.

Definition at line 1243 of file Graph.h.

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
size_t Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex::nOutEdges ( ) const
inline

Number of outgoing edges.

Returns the out-degree of this vertex, the length of the list returned by outEdges.

Definition at line 1250 of file Graph.h.

Referenced by Sawyer::Container::Algorithm::graphEraseParallelEdges().

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
size_t Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex::degree ( ) const
inline

Number of incident edges.

Returns the total number of incident edges, the sum of nInEdges and nOutEdges. Self-edges are counted two times: once for the source end, and once for the target end.

Definition at line 1258 of file Graph.h.

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
VertexValue& Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex::value ( )
inline

User-defined value.

Each vertex stores one user-defined value whose type is specified as the V parameter of the Graph template (a.k.a., the VertexValue type). This method returns a reference to that data, which was copied into the graph when this vertex was inserted. This is also the value that is returned when a vertex value iterator (VertexValueIterator or ConstVertexValueIterator) is dereferenced.

Time complexity is constant.

Definition at line 1272 of file Graph.h.

Referenced by Sawyer::Container::Algorithm::graphCopySubgraph(), and Sawyer::Container::Graph< AbstractLocation, DataFlowEdge >::operator=().

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
const VertexValue& Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Vertex::value ( ) const
inline

User-defined value.

Each vertex stores one user-defined value whose type is specified as the V parameter of the Graph template (a.k.a., the VertexValue type). This method returns a reference to that data, which was copied into the graph when this vertex was inserted. This is also the value that is returned when a vertex value iterator (VertexValueIterator or ConstVertexValueIterator) is dereferenced.

Time complexity is constant.

Definition at line 1273 of file Graph.h.


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