A special kind of graph in the form of a tree with directed edges and optional edge annotations of templatized type "TYPE_EDGES".
The tree is represented by means of:
This class is less general than CDirectedGraph but more efficient to traverse (see visitDepthFirst and visitBreadthFirst).
If annotations in edges are not required, you can leave TYPE_EDGES to its default type "uint8_t".
Definition at line 35 of file CDirectedTree.h.
#include <mrpt/graphs/CDirectedTree.h>
Classes | |
| struct | TEdgeInfo |
| struct | Visitor |
| Virtual base class for user-defined visitors. More... | |
Public Types | |
| typedef std::list< TEdgeInfo > | TListEdges |
| typedef std::map< TNodeID, TListEdges > | TMapNode2ListEdges |
Public Member Functions | |
Utilities | |
| void | clear () |
| Empty all edge data and set "root" to INVALID_NODEID. More... | |
| void | visitDepthFirst (const TNodeID root, Visitor &user_visitor, const size_t root_depth_level=0) const |
| Depth-first visit of all children nodes of a given root (itself excluded from the visit), invoking a user-provided function for each node/edge. More... | |
| void | visitBreadthFirst (const TNodeID root, Visitor &user_visitor, const size_t root_depth_level=0) const |
| Breadth-first visit of all children nodes of a given root (itself excluded from the visit), invoking a user-provided function for each node/edge. More... | |
| std::string | getAsTextDescription () const |
| Return a text representation of the tree spanned in a depth-first view, as in this example: More... | |
Public Attributes | |
Data | |
| TNodeID | root |
| The root of the tree. More... | |
| TMapNode2ListEdges | edges_to_children |
| The edges of each node. More... | |
| typedef std::list<TEdgeInfo> mrpt::graphs::CDirectedTree< TYPE_EDGES >::TListEdges |
Definition at line 44 of file CDirectedTree.h.
| typedef std::map<TNodeID,TListEdges> mrpt::graphs::CDirectedTree< TYPE_EDGES >::TMapNode2ListEdges |
Definition at line 45 of file CDirectedTree.h.
|
inline |
Empty all edge data and set "root" to INVALID_NODEID.
Definition at line 57 of file CDirectedTree.h.
References INVALID_NODEID.
Referenced by mrpt::graphs::CDijkstra< TYPE_GRAPH, MAPS_IMPLEMENTATION >::getTreeGraph().
|
inline |
Return a text representation of the tree spanned in a depth-first view, as in this example:
Definition at line 110 of file CDirectedTree.h.
References mrpt::graphs::CDirectedTree< TYPE_EDGES >::TEdgeInfo::id, mrpt::graphs::CDirectedTree< TYPE_EDGES >::TEdgeInfo::reverse, and mrpt::graphs::CDirectedTree< TYPE_EDGES >::visitDepthFirst().
|
inline |
Breadth-first visit of all children nodes of a given root (itself excluded from the visit), invoking a user-provided function for each node/edge.
Definition at line 88 of file CDirectedTree.h.
References mrpt::graphs::CDirectedTree< TYPE_EDGES >::Visitor::OnVisitNode(), and mrpt::graphs::CDirectedTree< TYPE_EDGES >::visitDepthFirst().
|
inline |
Depth-first visit of all children nodes of a given root (itself excluded from the visit), invoking a user-provided function for each node/edge.
Definition at line 74 of file CDirectedTree.h.
References mrpt::graphs::CDirectedTree< TYPE_EDGES >::Visitor::OnVisitNode().
Referenced by mrpt::graphs::CDirectedTree< TYPE_EDGES >::getAsTextDescription(), and mrpt::graphs::CDirectedTree< TYPE_EDGES >::visitBreadthFirst().
| TMapNode2ListEdges mrpt::graphs::CDirectedTree< TYPE_EDGES >::edges_to_children |
The edges of each node.
Definition at line 50 of file CDirectedTree.h.
Referenced by mrpt::graphs::CDijkstra< TYPE_GRAPH, MAPS_IMPLEMENTATION >::getTreeGraph().
| TNodeID mrpt::graphs::CDirectedTree< TYPE_EDGES >::root |
The root of the tree.
Definition at line 49 of file CDirectedTree.h.
Referenced by mrpt::graphs::CDijkstra< TYPE_GRAPH, MAPS_IMPLEMENTATION >::getTreeGraph().
| Page generated by Doxygen 1.8.8 for MRPT 1.2.2 SVN:Unversioned directory at Tue Oct 14 02:14:08 UTC 2014 |