#include <hyper_graph.h>
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_ELEMS > | GraphElemBitset |
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 EdgeSet & | edges () const |
EdgeSet & | edges () |
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... | |
Vertex * | vertex (int id) |
returns a vertex id in the hyper-graph, or 0 if the vertex id is not present More... | |
const Vertex * | vertex (int id) const |
returns a vertex id in the hyper-graph, or 0 if the vertex id is not present More... | |
const VertexIDMap & | vertices () const |
VertexIDMap & | vertices () |
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 &) | |
HyperGraph & | operator= (const HyperGraph &) |
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.
typedef std::set<Edge*> g2o::HyperGraph::EdgeSet |
Definition at line 90 of file hyper_graph.h.
typedef std::bitset<HyperGraph::HGET_NUM_ELEMS> g2o::HyperGraph::GraphElemBitset |
Definition at line 74 of file hyper_graph.h.
typedef std::vector<Vertex*> g2o::HyperGraph::VertexContainer |
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.
typedef std::set<Vertex*> g2o::HyperGraph::VertexSet |
Definition at line 91 of file hyper_graph.h.
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.
g2o::HyperGraph::HyperGraph | ( | ) |
constructs an empty hyper graph
Definition at line 147 of file hyper_graph.cpp.
|
virtual |
destroys the hyper-graph and all the vertices of the graph
Definition at line 161 of file hyper_graph.cpp.
|
inlineprivate |
Definition at line 212 of file hyper_graph.h.
|
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.
|
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.
|
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.
|
virtual |
clears the graph and empties all structures.
Reimplemented in g2o::SparseOptimizer.
Definition at line 151 of file hyper_graph.cpp.
|
inline |
Definition at line 182 of file hyper_graph.h.
|
inline |
Definition at line 184 of file hyper_graph.h.
|
inlineprivate |
Definition at line 213 of file hyper_graph.h.
|
virtual |
removes a vertex from the graph. Returns true on success (edge was present)
Definition at line 129 of file hyper_graph.cpp.
|
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.
|
inline |
Definition at line 177 of file hyper_graph.h.
|
inline |
Definition at line 179 of file hyper_graph.h.
|
protected |
Definition at line 208 of file hyper_graph.h.
|
protected |
Definition at line 207 of file hyper_graph.h.