ROSE  0.11.96.11
Public Member Functions | List of all members
Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Edge 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 >::Edge

Edge node.

These list nodes contain all information about an edge and are the objects returned (by reference) when an edge node iterator (EdgeIterator or ConstEdgeIterator) is dereferenced.

Definition at line 1116 of file Graph.h.

#include <Graph.h>

Public Member Functions

const size_t & id () const
 Unique edge ID number. More...
 
bool isSelfEdge () const
 Determines if edge is a self-edge. More...
 
const VertexIteratorsource ()
 Source vertex. More...
 
ConstVertexIterator source () const
 Source vertex. More...
 
const VertexIteratortarget ()
 Target vertex. More...
 
ConstVertexIterator target () const
 Target vertex. More...
 
EdgeValuevalue ()
 User-defined value. More...
 
const EdgeValuevalue () const
 User-defined value. More...
 

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 >::Edge::id ( ) const
inline

Unique edge ID number.

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

Time complexity is constant.

Definition at line 1135 of file Graph.h.

Referenced by Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::eraseEdge(), and Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::isValidEdge().

Here is the caller graph for this function:

◆ source() [1/2]

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

Source vertex.

All edges in a graph are directed edges, and this method returns an iterator (pointer) to the vertex that serves as the source of this edge.

Time complexity is constant.

Definition at line 1145 of file Graph.h.

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

Here is the caller graph for this function:

◆ source() [2/2]

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
ConstVertexIterator Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Edge::source ( ) const
inline

Source vertex.

All edges in a graph are directed edges, and this method returns an iterator (pointer) to the vertex that serves as the source of this edge.

Time complexity is constant.

Definition at line 1146 of file Graph.h.

◆ target() [1/2]

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

◆ target() [2/2]

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
ConstVertexIterator Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Edge::target ( ) const
inline

Target vertex.

All edges in a graph are directed edges, and this method returns an iterator (pointer) to the vertex that serves as the destination of this edge.

Time complexity is constant.

Definition at line 1158 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>
EdgeValue& Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Edge::value ( )
inline

User-defined value.

Each edge stores one user-defined value whose type is specified as the E parameter of the Graph template (a.k.a., the EdgeValue type). This method returns a reference to that data, which was copied into the graph when this edge was inserted. This is also the value that is returned when an edge value iterator (EdgeValueIterator or ConstEdgeValueIterator) is dereferenced.

Time complexity is constant.

Definition at line 1171 of file Graph.h.

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

Here is the caller graph for this function:

◆ value() [2/2]

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

User-defined value.

Each edge stores one user-defined value whose type is specified as the E parameter of the Graph template (a.k.a., the EdgeValue type). This method returns a reference to that data, which was copied into the graph when this edge was inserted. This is also the value that is returned when an edge value iterator (EdgeValueIterator or ConstEdgeValueIterator) is dereferenced.

Time complexity is constant.

Definition at line 1172 of file Graph.h.

◆ isSelfEdge()

template<class V = Nothing, class E = Nothing, class VKey = GraphVertexNoKey<V>, class EKey = GraphEdgeNoKey<E>, class Alloc = DefaultAllocator>
bool Sawyer::Container::Graph< V, E, VKey, EKey, Alloc >::Edge::isSelfEdge ( ) const
inline

Determines if edge is a self-edge.

Returns true if this edge is a self edge. A self edge is an edge whose source and target vertices are the same vertex.

Definition at line 1179 of file Graph.h.


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