MRPT logo

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 >
typedef type_edges_map::const_iterator mrpt::math::CDirectedGraph< TYPE_EDGES >::const_iterator

Definition at line 51 of file graphs.h.

template<class TYPE_EDGES >
typedef type_edges_map::iterator mrpt::math::CDirectedGraph< TYPE_EDGES >::iterator

Definition at line 52 of file graphs.h.

template<class TYPE_EDGES >
typedef TYPE_EDGES mrpt::math::CDirectedGraph< TYPE_EDGES >::type_edges

The type of the graph edges.

Definition at line 49 of file graphs.h.

template<class TYPE_EDGES >
typedef std::map< std::pair<size_t,size_t>, TYPE_EDGES > mrpt::math::CDirectedGraph< TYPE_EDGES >::type_edges_map

The type of the member "edges".

Definition at line 50 of file graphs.h.


Constructor & Destructor Documentation

template<class TYPE_EDGES >
mrpt::math::CDirectedGraph< TYPE_EDGES >::CDirectedGraph ( const type_edges_map obj  )  [inline]

Copy constructor from a map<pair< >, >.

Definition at line 57 of file graphs.h.

template<class TYPE_EDGES >
mrpt::math::CDirectedGraph< TYPE_EDGES >::CDirectedGraph (  )  [inline]

Default constructor.

Definition at line 58 of file graphs.h.


Member Function Documentation

template<class TYPE_EDGES >
const_iterator mrpt::math::CDirectedGraph< TYPE_EDGES >::begin (  )  const [inline]

Definition at line 65 of file graphs.h.

template<class TYPE_EDGES >
iterator mrpt::math::CDirectedGraph< TYPE_EDGES >::begin (  )  [inline]

Definition at line 63 of file graphs.h.

template<class TYPE_EDGES >
void mrpt::math::CDirectedGraph< TYPE_EDGES >::clearEdges (  )  [inline]

Erase all edges.

Definition at line 61 of file graphs.h.

template<class TYPE_EDGES >
size_t mrpt::math::CDirectedGraph< TYPE_EDGES >::edgeCount (  )  const [inline]

The number of edges in the graph.

Definition at line 60 of file graphs.h.

template<class TYPE_EDGES >
bool mrpt::math::CDirectedGraph< TYPE_EDGES >::edgeExists ( size_t  from_nodeID,
size_t  to_nodeID 
) const [inline]

Test is the given directed edge exists.

Definition at line 73 of file graphs.h.

template<class TYPE_EDGES >
const_iterator mrpt::math::CDirectedGraph< TYPE_EDGES >::end (  )  const [inline]

Definition at line 66 of file graphs.h.

template<class TYPE_EDGES >
iterator mrpt::math::CDirectedGraph< TYPE_EDGES >::end (  )  [inline]

Definition at line 64 of file graphs.h.

Referenced by mrpt::math::CDijkstra< TYPE_EDGES >::CDijkstra().

template<class TYPE_EDGES >
void mrpt::math::CDirectedGraph< TYPE_EDGES >::eraseEdge ( size_t  from_nodeID,
size_t  to_nodeID 
) [inline]

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 >
void mrpt::math::CDirectedGraph< TYPE_EDGES >::getAllNodes ( std::set< size_t > &  lstNode_IDs  )  const [inline]

Return a list of all the node_ID's of the graph, generated from all the nodes that appear in the list of edges.

Definition at line 107 of file graphs.h.

Referenced by mrpt::math::CDijkstra< TYPE_EDGES >::CDijkstra().

template<class TYPE_EDGES >
const TYPE_EDGES& mrpt::math::CDirectedGraph< TYPE_EDGES >::getEdge ( size_t  from_nodeID,
size_t  to_nodeID 
) const [inline]

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 >
TYPE_EDGES& mrpt::math::CDirectedGraph< TYPE_EDGES >::getEdge ( size_t  from_nodeID,
size_t  to_nodeID 
) [inline]

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]

Return the list of all neighbors of "nodeID", by creating a list of their node IDs.

Definition at line 118 of file graphs.h.

Referenced by mrpt::math::CDijkstra< TYPE_EDGES >::CDijkstra().

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 >
type_edges_map mrpt::math::CDirectedGraph< TYPE_EDGES >::edges




Page generated by Doxygen 1.5.7.1 for MRPT 0.7.1 SVN: at Mon Aug 17 23:10:56 EDT 2009