Classes | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | List of all members
g2o::HyperGraph Class Reference

#include <hyper_graph.h>

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

Classes

class  Edge
 
struct  HyperGraphElement
 
class  Vertex
 abstract Vertex, your types must derive from that one More...
 

Public Types

typedef std::set< Edge * > EdgeSet
 
typedef std::bitset< HyperGraph::HGET_NUM_ELEMSGraphElemBitset
 
enum  HyperGraphElementType {
  HGET_VERTEX, HGET_EDGE, HGET_PARAMETER, HGET_CACHE,
  HGET_DATA, HGET_NUM_ELEMS
}
 enum of all the types we have in our graphs More...
 
typedef std::vector< Vertex * > VertexContainer
 
typedef std::tr1::unordered_map< int, Vertex * > VertexIDMap
 
typedef std::set< Vertex * > VertexSet
 

Public Member Functions

virtual bool addEdge (Edge *e)
 
virtual bool addVertex (Vertex *v)
 
virtual bool changeId (Vertex *v, int newId)
 
virtual void clear ()
 clears the graph and empties all structures. More...
 
const EdgeSetedges () const
 
EdgeSetedges ()
 
 HyperGraph ()
 constructs an empty hyper graph More...
 
virtual bool removeEdge (Edge *e)
 removes a vertex from the graph. Returns true on success (edge was present) More...
 
virtual bool removeVertex (Vertex *v)
 removes a vertex from the graph. Returns true on success (vertex was present) More...
 
Vertexvertex (int id)
 returns a vertex id in the hyper-graph, or 0 if the vertex id is not present More...
 
const Vertexvertex (int id) const
 returns a vertex id in the hyper-graph, or 0 if the vertex id is not present More...
 
const VertexIDMapvertices () const
 
VertexIDMapvertices ()
 
virtual ~HyperGraph ()
 destroys the hyper-graph and all the vertices of the graph More...
 

Protected Attributes

EdgeSet _edges
 
VertexIDMap _vertices
 

Private Member Functions

 HyperGraph (const HyperGraph &)
 
HyperGraphoperator= (const HyperGraph &)
 

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 58 of file hyper_graph.h.

Member Typedef Documentation

Definition at line 90 of file hyper_graph.h.

Definition at line 74 of file hyper_graph.h.

Definition at line 94 of file hyper_graph.h.

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

Definition at line 93 of file hyper_graph.h.

Definition at line 91 of file hyper_graph.h.

Member Enumeration Documentation

enum of all the types we have in our graphs

Enumerator
HGET_VERTEX 
HGET_EDGE 
HGET_PARAMETER 
HGET_CACHE 
HGET_DATA 
HGET_NUM_ELEMS 

Definition at line 65 of file hyper_graph.h.

Constructor & Destructor Documentation

g2o::HyperGraph::HyperGraph ( )

constructs an empty hyper graph

Definition at line 147 of file hyper_graph.cpp.

g2o::HyperGraph::~HyperGraph ( )
virtual

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

Definition at line 161 of file hyper_graph.cpp.

g2o::HyperGraph::HyperGraph ( const HyperGraph )
inlineprivate

Definition at line 212 of file hyper_graph.h.

Member Function Documentation

bool g2o::HyperGraph::addEdge ( Edge e)
virtual

Adds an edge to the graph. If the edge is already in the graph, it does nothing and returns false. Otherwise it returns true.

Reimplemented in g2o::OptimizableGraph.

Definition at line 99 of file hyper_graph.cpp.

bool g2o::HyperGraph::addVertex ( Vertex v)
virtual

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 true, on success, or false on failure.

Reimplemented in g2o::OptimizableGraph.

Definition at line 76 of file hyper_graph.cpp.

bool g2o::HyperGraph::changeId ( Vertex v,
int  newId 
)
virtual

changes the id of a vertex already in the graph, and updates the bookkeeping @ returns false if the vertex is not in the graph;

Definition at line 89 of file hyper_graph.cpp.

void g2o::HyperGraph::clear ( )
virtual

clears the graph and empties all structures.

Reimplemented in g2o::SparseOptimizer.

Definition at line 151 of file hyper_graph.cpp.

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

Definition at line 182 of file hyper_graph.h.

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

Definition at line 184 of file hyper_graph.h.

HyperGraph& g2o::HyperGraph::operator= ( const HyperGraph )
inlineprivate

Definition at line 213 of file hyper_graph.h.

bool g2o::HyperGraph::removeEdge ( Edge e)
virtual

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

Definition at line 129 of file hyper_graph.cpp.

bool g2o::HyperGraph::removeVertex ( Vertex v)
virtual

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

Reimplemented in g2o::SparseOptimizer.

Definition at line 111 of file hyper_graph.cpp.

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

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

Definition at line 60 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

Definition at line 68 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 177 of file hyper_graph.h.

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

Definition at line 179 of file hyper_graph.h.

Member Data Documentation

EdgeSet g2o::HyperGraph::_edges
protected

Definition at line 208 of file hyper_graph.h.

VertexIDMap g2o::HyperGraph::_vertices
protected

Definition at line 207 of file hyper_graph.h.


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


orb_slam2_with_maps_odom
Author(s): teng zhang
autogenerated on Fri Sep 25 2020 03:24:47