#include <directed_graph.hpp>
|
using | Index_t = int32_t |
|
using | AdjacencyList = iox::cxx::vector< VertexType *, DEGREE_LIMIT > |
|
|
static constexpr Index_t | INVALID_INDEX = -1 |
|
|
Index_t | findVertex (VertexType const *vertex) const |
|
bool | isValid (Index_t index) |
|
template<typename VertexType, int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
class DirectedGraph< VertexType, VERTEX_LIMIT, DEGREE_LIMIT >
- Todo:
- : refine and move to utils
◆ addEdge()
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
virtual bool DirectedGraph< VertexType, VERTEX_LIMIT, DEGREE_LIMIT >::addEdge |
( |
VertexType * |
fromVertex, |
|
|
VertexType * |
toVertex |
|
) |
| |
|
inlinevirtual |
◆ addVertex()
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
bool DirectedGraph< VertexType, VERTEX_LIMIT, DEGREE_LIMIT >::addVertex |
( |
VertexType * |
vertex | ) |
|
|
inline |
add a vertex to the graph
- Parameters
-
[in] | vertex | vertex to be added |
- Returns
- pointer true if the vertex was added successfully, false otherwise (e.g. capacity reached or vertex already exists)
◆ getIndex()
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
Index_t DirectedGraph< VertexType, VERTEX_LIMIT, DEGREE_LIMIT >::getIndex |
( |
VertexType const * |
vertex | ) |
|
|
inline |
get the internal index of a given vertex
- Parameters
-
[in] | vertex | vertex of which the index is requested |
- Returns
- internal index of vertex, -1 if vertex does not exist
◆ getPredecessors() [1/2]
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
get the direct predecessors of a given vertex index in the graph
- Parameters
-
[in] | index | index of vertex of which the predecessors are requested |
- Returns
- pointer to the list of predecessors, nullptr if index does not exist in the graph
◆ getPredecessors() [2/2]
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
get the direct predecessors of a given vertex in the graph
- Parameters
-
[in] | vertex | vertex of which the predecessors are requested |
- Returns
- pointer to the list of predecessors, nullptr if vertex does not exist
◆ getSinks()
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
get the sink vertices of the graph, i.e. vertices without outgoing edges
- Returns
- vector filled with sink vertices (might be empty if e.g. the graph is a cycle)
◆ getSources()
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
get the source vertices of the graph, i.e. vertices without incoming edges
- Returns
- vector filled with source vertices (might be empty if e.g. the graph is a cycle)
◆ getSuccessors() [1/2]
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
get the direct successors of a given vertex index in the graph
- Parameters
-
[in] | index | index of vertex of which the successors are requested |
- Returns
- pointer to the list of successors, nullptr if index does not exist in the graph
◆ getSuccessors() [2/2]
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
get the direct successors of a given vertex in the graph
- Parameters
-
[in] | vertex | vertex of which the successors are requested |
- Returns
- pointer to the list of successors, nullptr if vertex does not exist
◆ isSink()
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
bool DirectedGraph< VertexType, VERTEX_LIMIT, DEGREE_LIMIT >::isSink |
( |
VertexType const * |
vertex | ) |
|
|
inline |
check whether the given vertex is a sink
- Parameters
-
- Returns
- true if the vertex is a sink
◆ isSource()
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
bool DirectedGraph< VertexType, VERTEX_LIMIT, DEGREE_LIMIT >::isSource |
( |
VertexType const * |
vertex | ) |
|
|
inline |
check whether the given vertex is a source
- Parameters
-
- Returns
- true iff the vertex is a source
◆ numberOfEdges()
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
size_t DirectedGraph< VertexType, VERTEX_LIMIT, DEGREE_LIMIT >::numberOfEdges |
( |
| ) |
|
|
inline |
get the number of edges
- Returns
- number of edges
◆ numberOfVertices()
template<typename VertexType , int32_t VERTEX_LIMIT, int32_t DEGREE_LIMIT>
size_t DirectedGraph< VertexType, VERTEX_LIMIT, DEGREE_LIMIT >::numberOfVertices |
( |
| ) |
|
|
inline |
get the number of vertices
- Returns
- number of vertices
The documentation for this class was generated from the following file: