Graph Class Reference

#include <Beobot/Graph.H>

Collaboration diagram for Graph:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Constructor, assigment and destructor

 Graph ()
 Constructor: generate a blank graph.
 Graph (std::vector< rutz::shared_ptr< Node > > nodes, std::vector< rutz::shared_ptr< Edge > > edges)
 Constructor: generate a graph with edges.
 ~Graph ()
 Destructor.
void addNode (rutz::shared_ptr< Node >)
 add edges and nodes
void addEdge (rutz::shared_ptr< Edge >)
Access functions

uint getNumNode ()
 get node and edge size
uint getNumEdge ()
rutz::shared_ptr< NodegetNode (uint index)
 get node or edge of the passed in index
rutz::shared_ptr< EdgegetEdge (uint index)
Compute functions

void computeAdjecencyList ()
 compute the adjecency list
void computeDistances ()
 compute all the shortcuts for shortest-distance related operations
float getDirectedDistance (uint a, uint b, std::vector< uint > &edges)
float getDirectedDistance (uint a, uint b)
float getUndirectedDistance (uint a, uint b, std::vector< uint > &edges)
float getUndirectedDistance (uint a, uint b)
float getMaxDirectedDistance ()
float getMaxUndirectedDistance ()
std::vector< uintgetDirectedPath (uint a, uint b)
 get the directed path from node A to Note B
std::vector< uintgetUndirectedPath (uint a, uint b)
 get the undirected path from node A to Note B
std::vector< uintgetEdges (rutz::shared_ptr< Node > n)
 get all the edge that connects to this node
float getAngle (rutz::shared_ptr< Edge > e1, rutz::shared_ptr< Edge > e2)

Detailed Description

basic graph class has all the access functions and shortest path no input/output file function because usually the file has to be filled with extra information

Definition at line 50 of file Graph.H.


Constructor & Destructor Documentation

Graph::Graph (  ) 

Constructor: generate a blank graph.

Definition at line 46 of file Graph.C.

Graph::Graph ( std::vector< rutz::shared_ptr< Node > >  nodes,
std::vector< rutz::shared_ptr< Edge > >  edges 
)

Constructor: generate a graph with edges.

Definition at line 63 of file Graph.C.

Graph::~Graph (  ) 

Destructor.

Definition at line 87 of file Graph.C.


Member Function Documentation

void Graph::addNode ( rutz::shared_ptr< Node node  ) 

add edges and nodes

Definition at line 91 of file Graph.C.

void Graph::computeAdjecencyList (  ) 

compute the adjecency list

Definition at line 103 of file Graph.C.

void Graph::computeDistances (  ) 

compute all the shortcuts for shortest-distance related operations

Definition at line 143 of file Graph.C.

References getDirectedDistance(), getUndirectedDistance(), Image< T >::resize(), and Image< T >::setVal().

float Graph::getAngle ( rutz::shared_ptr< Edge e1,
rutz::shared_ptr< Edge e2 
)

get the angle (in radians) between two edges they two edges do not have to have a common node angles are intuitive from the tip of the incoming (e1) edge perspective 0 degrees/radians means continue the same direction 180/-180 degrees or M_PI/-M_PI means turn around positive angle to the right, negative angle to the left

Definition at line 485 of file Graph.C.

References Point2D< T >::i, and sqrt().

float Graph::getDirectedDistance ( uint  a,
uint  b,
std::vector< uint > &  edges 
)

get the shortest distance from node A to node B using Dijkstra shortest-path algorithm for the directed graph

Definition at line 189 of file Graph.C.

References ASSERT.

Referenced by computeDistances(), and getDirectedPath().

std::vector< uint > Graph::getDirectedPath ( uint  a,
uint  b 
)

get the directed path from node A to Note B

Definition at line 440 of file Graph.C.

References getDirectedDistance().

std::vector< uint > Graph::getEdges ( rutz::shared_ptr< Node n  ) 

get all the edge that connects to this node

Definition at line 468 of file Graph.C.

float Graph::getMaxDirectedDistance (  ) 

get the maximum distance of any 2 points in the map return -1.0F if the graph is unconnected for the directed graph

Definition at line 422 of file Graph.C.

References getMinMax(), max(), and min().

float Graph::getMaxUndirectedDistance (  ) 

get the maximum distance of any 2 points in the map return -1.0F if the graph is unconnected for undirected graph

Definition at line 431 of file Graph.C.

References getMinMax(), max(), and min().

rutz::shared_ptr< Node > Graph::getNode ( uint  index  )  [inline]

get node or edge of the passed in index

Definition at line 180 of file Graph.H.

References ASSERT.

uint Graph::getNumNode (  )  [inline]

get node and edge size

Definition at line 170 of file Graph.H.

float Graph::getUndirectedDistance ( uint  a,
uint  b,
std::vector< uint > &  edges 
)

get the shortest distance from node A to node B using Dijkstra shortest-path algorithm for the undirected graph

Definition at line 308 of file Graph.C.

References ASSERT.

Referenced by computeDistances(), and getUndirectedPath().

std::vector< uint > Graph::getUndirectedPath ( uint  a,
uint  b 
)

get the undirected path from node A to Note B

Definition at line 454 of file Graph.C.

References getUndirectedDistance().


The documentation for this class was generated from the following files:
Generated on Sun May 8 08:43:21 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3