mrpt::math::CDirectedGraph< TYPE_EDGES > Class Template Reference
A directed graph with the argument of the template specifying the type of the annotations in the edges.
More...
#include <mrpt/math/graphs.h>
List of all members.
Public Types |
| typedef TYPE_EDGES | type_edges |
| | The type of the graph edges.
|
typedef std::map< std::pair
< size_t, size_t >, TYPE_EDGES > | type_edges_map |
| | The type of the member "edges".
|
typedef
type_edges_map::const_iterator | const_iterator |
| typedef type_edges_map::iterator | iterator |
Public Member Functions |
| | CDirectedGraph (const type_edges_map &obj) |
| | Copy constructor from a map<pair< >, >.
|
| | CDirectedGraph () |
| | Default constructor.
|
| size_t | edgeCount () const |
| | The number of edges in the graph.
|
| void | clearEdges () |
| | Erase all edges.
|
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| void | insertEdge (size_t from_nodeID, size_t to_nodeID, const TYPE_EDGES &edge_value) |
| | Insert an edge (from -> to) with the given edge value.
|
| bool | edgeExists (size_t from_nodeID, size_t to_nodeID) const |
| | Test is the given directed edge exists.
|
| TYPE_EDGES & | getEdge (size_t from_nodeID, size_t to_nodeID) |
| | Return a reference to the content of a given edge.
|
| const TYPE_EDGES & | getEdge (size_t from_nodeID, size_t to_nodeID) const |
| | Return a reference to the content of a given edge.
|
| void | eraseEdge (size_t from_nodeID, size_t to_nodeID) |
| | Erase a given edge (it has no effect if the edge didn't exist).
|
| void | getAllNodes (std::set< size_t > &lstNode_IDs) const |
| | Return a list of all the node_ID's of the graph, generated from all the nodes that appear in the list of edges.
|
| void | getNeighborsOf (const size_t nodeID, std::set< size_t > &neighborIDs) const |
| | Return the list of all neighbors of "nodeID", by creating a list of their node IDs.
|
Public Attributes |
| type_edges_map | edges |
| | The public member with the directed edges in the graph.
|
Detailed Description
template<class TYPE_EDGES>
class mrpt::math::CDirectedGraph< TYPE_EDGES >
A directed graph with the argument of the template specifying the type of the annotations in the edges.
This class only keeps a list of edges (in the member "edges"), so there is no information stored for each node but its existence referred by a node_ID.
- See also:
- mrpt::math::CDijkstra, mrpt::poses::CNetworkOfPoses
Definition at line 46 of file graphs.h.
Member Typedef Documentation
template<class TYPE_EDGES>
template<class TYPE_EDGES>
template<class TYPE_EDGES>
The type of the graph edges.
Definition at line 49 of file graphs.h.
template<class TYPE_EDGES>
The type of the member "edges".
Definition at line 50 of file graphs.h.
Constructor & Destructor Documentation
template<class TYPE_EDGES>
Copy constructor from a map<pair< >, >.
Definition at line 57 of file graphs.h.
template<class TYPE_EDGES>
Default constructor.
Definition at line 58 of file graphs.h.
Member Function Documentation
template<class TYPE_EDGES>
template<class TYPE_EDGES>
template<class TYPE_EDGES>
Erase all edges.
Definition at line 61 of file graphs.h.
template<class TYPE_EDGES>
The number of edges in the graph.
Definition at line 60 of file graphs.h.
template<class TYPE_EDGES>
Test is the given directed edge exists.
Definition at line 73 of file graphs.h.
template<class TYPE_EDGES>
template<class TYPE_EDGES>
template<class TYPE_EDGES>
Erase a given edge (it has no effect if the edge didn't exist).
Definition at line 100 of file graphs.h.
template<class TYPE_EDGES>
template<class TYPE_EDGES>
Return a reference to the content of a given edge.
- Exceptions:
-
| std::exception | if the given edge does not exist |
Definition at line 90 of file graphs.h.
template<class TYPE_EDGES>
Return a reference to the content of a given edge.
- Exceptions:
-
| std::exception | if the given edge does not exist |
Definition at line 79 of file graphs.h.
template<class TYPE_EDGES>
| void mrpt::math::CDirectedGraph< TYPE_EDGES >::getNeighborsOf |
( |
const size_t |
nodeID, |
|
|
std::set< size_t > & |
neighborIDs | |
|
) |
| | const [inline] |
template<class TYPE_EDGES>
| void mrpt::math::CDirectedGraph< TYPE_EDGES >::insertEdge |
( |
size_t |
from_nodeID, |
|
|
size_t |
to_nodeID, |
|
|
const TYPE_EDGES & |
edge_value | |
|
) |
| | [inline] |
Insert an edge (from -> to) with the given edge value.
Definition at line 69 of file graphs.h.
Member Data Documentation
template<class TYPE_EDGES>
The public member with the directed edges in the graph.
Definition at line 55 of file graphs.h.
Referenced by mrpt::math::CDirectedGraph< CPOSE >::begin(), mrpt::math::CDijkstra< TYPE_EDGES >::CDijkstra(), mrpt::math::CDirectedGraph< CPOSE >::clearEdges(), mrpt::math::CDirectedGraph< CPOSE >::edgeCount(), mrpt::math::CDirectedGraph< CPOSE >::edgeExists(), mrpt::math::CDirectedGraph< CPOSE >::end(), mrpt::math::CDirectedGraph< CPOSE >::eraseEdge(), mrpt::math::CDirectedGraph< CPOSE >::getAllNodes(), mrpt::math::CDirectedGraph< CPOSE >::getEdge(), mrpt::math::CDirectedGraph< CPOSE >::getNeighborsOf(), and mrpt::math::CDirectedGraph< CPOSE >::insertEdge().