62 VertexIDMap::iterator it=
_vertices.find(
id);
70 VertexIDMap::const_iterator it=
_vertices.find(
id);
101 std::pair<EdgeSet::iterator, bool> result =
_edges.insert(e);
104 for (std::vector<Vertex*>::iterator it = e->
vertices().begin(); it != e->
vertices().end(); ++it) {
106 v->
edges().insert(e);
116 assert(it->second==v);
119 for (EdgeSet::iterator it=tmp.begin(); it!=tmp.end(); ++it){
131 EdgeSet::iterator it =
_edges.find(e);
136 for (std::vector<Vertex*>::iterator vit = e->
vertices().begin(); vit != e->
vertices().end(); ++vit) {
138 it = v->
edges().find(e);
139 assert(it!=v->
edges().end());
140 v->
edges().erase(it);
155 for (EdgeSet::iterator it=
_edges.begin(); it!=
_edges.end(); ++it)
int id() const
returns the id
const Vertex * vertex(size_t i) const
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
Vertex(int id=-1)
creates a vertex having an ID specified by the argument
virtual bool addEdge(Edge *e)
virtual void setId(int newId)
std::set< Edge * > EdgeSet
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
Edge(int id=-1)
creates and empty edge with no vertices
virtual void clear()
clears the graph and empties all structures.
abstract Vertex, your types must derive from that one
virtual bool addVertex(Vertex *v)
virtual void resize(size_t size)
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 ~HyperGraph()
destroys the hyper-graph and all the vertices of the graph
VertexContainer _vertices