Classes | Public Types | Public Member Functions | Protected Attributes
g2o::HyperGraph Class Reference

#include <hyper_graph.h>

Inheritance diagram for g2o::HyperGraph:
Inheritance graph
[legend]

List of all members.

Classes

class  Edge
struct  HyperGraphElement
 base hyper graph element, specialized in vertex and edge More...
class  Vertex
 abstract Vertex, your types must derive from that one More...

Public Types

typedef std::set< Edge * > EdgeSet
typedef
std::tr1::unordered_map< int,
Vertex * > 
VertexIDMap
typedef std::set< Vertex * > VertexSet
typedef std::vector< Vertex * > VertexVector

Public Member Functions

EdgeaddEdge (Edge *e)
 adds an edge to the graph. If the edge is already in the graph, it does nothing and returns 0. otherwise it returns e.
VertexaddVertex (Vertex *v)
virtual void clear ()
 clears the graph and empties all structures.
const EdgeSetedges () const
EdgeSetedges ()
 HyperGraph ()
 constructs an empty hyper graph
virtual bool removeEdge (Edge *e)
 removes a vertex from the graph. Returns true on success (edge was present)
virtual bool removeVertex (Vertex *v)
 removes a vertex from the graph. Returns true on success (vertex was present)
Vertexvertex (int id)
 returns a vertex id in the hyper-graph, or 0 if the vertex id is not present
const Vertexvertex (int id) const
 returns a vertex id in the hyper-graph, or 0 if the vertex id is not present
const VertexIDMapvertices () const
VertexIDMapvertices ()
virtual ~HyperGraph ()
 destroys the hyper-graph and all the vertices of the graph

Protected Attributes

EdgeSet _edges
VertexIDMap _vertices

Detailed Description

Class that models a directed Hyper-Graph. An hyper graph is a graph where an edge can connect one or more nodes. Both Vertices and Edges of an hyoper graph derive from the same class HyperGraphElement, thus one can implement generic algorithms that operate transparently on edges or vertices (see HyperGraphAction).

The vertices are uniquely identified by an int id, while the edges are identfied by their pointers.

Definition at line 46 of file hyper_graph.h.


Member Typedef Documentation

Definition at line 57 of file hyper_graph.h.

typedef std::tr1::unordered_map<int, Vertex*> g2o::HyperGraph::VertexIDMap

Definition at line 60 of file hyper_graph.h.

Definition at line 58 of file hyper_graph.h.

Definition at line 61 of file hyper_graph.h.


Constructor & Destructor Documentation

constructs an empty hyper graph

Definition at line 123 of file hyper_graph.cpp.

destroys the hyper-graph and all the vertices of the graph

Definition at line 137 of file hyper_graph.cpp.


Member Function Documentation

adds an edge to the graph. If the edge is already in the graph, it does nothing and returns 0. otherwise it returns e.

Definition at line 75 of file hyper_graph.cpp.

adds a vertex to the graph. The id of the vertex should be set before invoking this function. the function fails if another vertex with the same id is already in the graph. returns a poiner to the vertex, on success, or 0 on failure.

Definition at line 66 of file hyper_graph.cpp.

void g2o::HyperGraph::clear ( void  ) [virtual]

clears the graph and empties all structures.

Reimplemented in g2o::SparseOptimizer.

Definition at line 127 of file hyper_graph.cpp.

const EdgeSet& g2o::HyperGraph::edges ( ) const [inline]
Returns:
the set of edges of the hyper graph

Definition at line 134 of file hyper_graph.h.

Returns:
the set of edges of the hyper graph

Definition at line 136 of file hyper_graph.h.

removes a vertex from the graph. Returns true on success (edge was present)

Definition at line 105 of file hyper_graph.cpp.

removes a vertex from the graph. Returns true on success (vertex was present)

Reimplemented in g2o::SparseOptimizer.

Definition at line 87 of file hyper_graph.cpp.

returns a vertex id in the hyper-graph, or 0 if the vertex id is not present

Reimplemented in g2o::OptimizableGraph.

Definition at line 50 of file hyper_graph.cpp.

const HyperGraph::Vertex * g2o::HyperGraph::vertex ( int  id) const

returns a vertex id in the hyper-graph, or 0 if the vertex id is not present

Reimplemented in g2o::OptimizableGraph.

Definition at line 58 of file hyper_graph.cpp.

const VertexIDMap& g2o::HyperGraph::vertices ( ) const [inline]
Returns:
the map id -> vertex where the vertices are stored

Definition at line 129 of file hyper_graph.h.

Returns:
the map id -> vertex where the vertices are stored

Definition at line 131 of file hyper_graph.h.


Member Data Documentation

Definition at line 151 of file hyper_graph.h.

Definition at line 150 of file hyper_graph.h.


The documentation for this class was generated from the following files:


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:34:30