27 #ifndef G2O_AIS_HYPER_GRAPH_HH 28 #define G2O_AIS_HYPER_GRAPH_HH 39 #include <unordered_map> 41 #include <tr1/unordered_map> 100 explicit Vertex(
int id=-1);
103 int id()
const {
return _id;}
104 virtual void setId(
int newId) { _id=newId; }
122 explicit Edge(
int id = -1);
128 virtual void resize(
size_t size);
150 int id()
const {
return _id;}
174 virtual void clear();
int id() const
returns the id
const Vertex * vertex(size_t i) const
std::vector< Vertex * > VertexContainer
std::bitset< HyperGraph::HGET_NUM_ELEMS > GraphElemBitset
std::set< Vertex * > VertexSet
HyperGraphElementType
enum of all the types we have in our graphs
virtual bool changeId(Vertex *v, int newId)
Vertex * vertex(int id)
returns a vertex id in the hyper-graph, or 0 if the vertex id is not present
void setVertex(size_t i, Vertex *v)
virtual bool addEdge(Edge *e)
const VertexIDMap & vertices() const
HyperGraph & operator=(const HyperGraph &)
virtual void setId(int newId)
std::set< Edge * > EdgeSet
Vertex * vertex(size_t i)
virtual bool removeVertex(Vertex *v)
removes a vertex from the graph. Returns true on success (vertex was present)
const VertexContainer & vertices() const
const EdgeSet & edges() const
returns the set of hyper-edges that are leaving/entering in this vertex
const EdgeSet & edges() const
VertexContainer & vertices()
virtual ~HyperGraphElement()
virtual void clear()
clears the graph and empties all structures.
virtual HyperGraphElementType elementType() const =0
abstract Vertex, your types must derive from that one
virtual HyperGraphElementType elementType() const
virtual bool addVertex(Vertex *v)
std::tr1::unordered_map< int, Vertex * > VertexIDMap
virtual HyperGraphElementType elementType() const
HyperGraph()
constructs an empty hyper graph
virtual bool removeEdge(Edge *e)
removes a vertex from the graph. Returns true on success (edge was present)
HyperGraph(const HyperGraph &)
EdgeSet & edges()
returns the set of hyper-edges that are leaving/entering in this vertex
virtual ~HyperGraph()
destroys the hyper-graph and all the vertices of the graph
VertexContainer _vertices