ROSE 0.11.145.147
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 1205 of file Graph.h.

#include <Sawyer/Graph.h>

Public Member Functions

const size_t & id () const
 Unique vertex ID number.
 
size_t nInEdges () const
 Number of incoming edges.
 
size_t nOutEdges () const
 Number of outgoing edges.
 
size_t degree () const
 Number of incident edges.
 
boost::iterator_range< EdgeIteratorinEdges ()
 List of incoming edges.
 
boost::iterator_range< ConstEdgeIteratorinEdges () const
 List of incoming edges.
 
boost::iterator_range< EdgeIteratoroutEdges ()
 List of outgoing edges.
 
boost::iterator_range< ConstEdgeIteratoroutEdges () const
 List of outgoing edges.
 
VertexValuevalue ()
 User-defined value.
 
const VertexValuevalue () const
 User-defined value.
 

Member Function Documentation

◆ id()

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 1225 of file Graph.h.

Referenced by Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::clearInEdges(), Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::clearOutEdges(), Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::eraseVertex(), Sawyer::Container::Algorithm::graphCopySubgraph(), Sawyer::Container::Algorithm::graphDependentOrder(), Sawyer::Container::Algorithm::graphFindConnectedComponents(), Sawyer::Container::Algorithm::graphIsConnected(), Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::insertEdge(), Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::insertEdgeMaybe(), Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::isValidVertex(), and Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::operator=().

◆ inEdges() [1/2]

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 1236 of file Graph.h.

Referenced by Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::clearInEdges(), Sawyer::Container::Algorithm::graphFindConnectedComponents(), and Sawyer::Container::Algorithm::graphIsConnected().

◆ inEdges() [2/2]

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 1241 of file Graph.h.

◆ outEdges() [1/2]

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 1257 of file Graph.h.

Referenced by Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::clearOutEdges(), Sawyer::Container::Algorithm::graphCopySubgraph(), Sawyer::Container::Algorithm::graphDependentOrder(), Sawyer::Container::Algorithm::graphEraseParallelEdges(), Sawyer::Container::Algorithm::graphFindConnectedComponents(), and Sawyer::Container::Algorithm::graphIsConnected().

◆ outEdges() [2/2]

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 1262 of file Graph.h.

◆ nInEdges()

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 1272 of file Graph.h.

◆ nOutEdges()

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 1279 of file Graph.h.

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

◆ degree()

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 1287 of file Graph.h.

◆ value() [1/2]

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 1301 of file Graph.h.

Referenced by Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::eraseVertex(), Sawyer::Container::Algorithm::graphCopySubgraph(), and Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::operator=().

◆ value() [2/2]

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 1302 of file Graph.h.


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