![]() |
NDEVR
API Documentation
|
Class that models a directed Hyper-Graph. More...
Classes | |
| class | HGEdge |
| Abstract Edge class. More... | |
| class | HGVertex |
| abstract Vertex, your types must derive from that one More... | |
Public Member Functions | |
| HyperGraph () | |
| constructs an empty hyper graph | |
| virtual | ~HyperGraph () |
| destroys the hyper-graph and all the vertices of the graph | |
| virtual bool | addEdge (HGEdge *e) |
| Adds an edge to the graph. | |
| virtual bool | addVertex (HGVertex &v) |
| adds a vertex to the graph. | |
| virtual void | clear () |
| removes a vertex from the graph. Returns true on success (vertex was present) | |
| Buffer< HGEdge * > & | edges () |
| const Buffer< HGEdge * > & | edges () const |
| HGVertex * | vertex (int id) |
| returns a vertex id in the hyper-graph, or 0 if the vertex id is not present | |
| const HGVertex * | vertex (int id) const |
| returns a vertex id in the hyper-graph, or 0 if the vertex id is not present | |
| Dictionary< int, HGVertex * > & | vertices () |
| const Dictionary< int, HGVertex * > & | vertices () const |
Protected Attributes | |
| Buffer< HGEdge * > | _edges |
| Collection of all edges in the graph. | |
| Dictionary< int, HGVertex * > | _vertices |
| Map from vertex id to vertex pointer. | |
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 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 19 of file hyper_graph.h.
|
inlinevirtual |
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 OptimizableGraph.
Definition at line 173 of file hyper_graph.h.
References _edges, HyperGraph::HGEdge::vertex(), and HyperGraph::HGEdge::vertexCount().
Referenced by OptimizableGraph::addEdge().
|
inlinevirtual |
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 OptimizableGraph.
Definition at line 162 of file hyper_graph.h.
References _vertices, and HyperGraph::HGVertex::id().
Referenced by OptimizableGraph::addVertex().
|
inlinevirtual |
removes a vertex from the graph. Returns true on success (vertex was present)
removes a vertex from the graph. Returns true on success (edge was present) clears the graph and empties all structures.
Reimplemented in SparseOptimizer.
Definition at line 140 of file hyper_graph.h.
References _edges, and _vertices.
Referenced by SparseOptimizer::clear().
Definition at line 154 of file hyper_graph.h.
References _edges.
Definition at line 152 of file hyper_graph.h.
References _edges.
Referenced by OptimizableGraph::chi2(), and SparseOptimizer::initializeOptimization().
|
inline |
Definition at line 149 of file hyper_graph.h.
References _vertices.
|
inline |
Definition at line 147 of file hyper_graph.h.
References _vertices.
Referenced by OptimizableGraph::dimensions(), SparseOptimizer::findGauge(), SparseOptimizer::gaugeFreedom(), SparseOptimizer::initializeOptimization(), and OptimizableGraph::maxDimension().