Graphitti
A toolkit/software architecture to ease creating high-performance neural network simulators
|
A templated wrapper around the Boost Graph Library (BGL). More...
#include <GraphManager.h>
Public Types | |
using | Graph |
Using directive for graphml graph type (adjacency list) | |
using | EdgeIterator = typename boost::graph_traits<Graph>::edge_iterator |
using | VertexIterator = typename boost::graph_traits<Graph>::vertex_iterator |
using | EdgeDescriptor = typename boost::graph_traits<Graph>::edge_descriptor |
Public Member Functions | |
void | setFilePath (string filePath) |
Set the path for the graphML File to be read. | |
template<class Property > | |
void | registerProperty (const string &propName, Property property) |
Registers a graph property with its attribute name in the graphml file. | |
bool | readGraph () |
Loads a graph from a graphml file into a BGL graph. | |
pair< VertexIterator, VertexIterator > | vertices () |
Exposes the BGL Vertex Iterators of the stored Graph. | |
pair< EdgeIterator, EdgeIterator > | edges () const |
Exposes the BGL Edge Iterators of the stored Graph. | |
size_t | source (const EdgeDescriptor &edge) const |
Retrieves the source vertex index for the given Edge. | |
size_t | target (const EdgeDescriptor &edge) const |
Retrieves the target vertex index for the given Edge. | |
double | weight (const EdgeDescriptor &edge) const |
Retrieves the weight of an edge. | |
VertexProperties & | operator[] (size_t vertex) |
Direct access to the VertexProperties of a vertex descriptor. | |
const VertexProperties & | operator[] (size_t vertex) const |
Direct access to the VertexProperties of a vertex descriptor. | |
const list< EdgeDescriptor > | edgesSortByTarget () const |
Returns a list of EdgeDescriptors in ascending order by target vertexID. | |
size_t | numVertices () const |
Retrieves the number of vertices in the current graph. | |
size_t | numEdges () const |
Retrieves the number of edges in the current graph. | |
GraphManager (const GraphManager &graphManager)=delete | |
Delete copy and move methods to avoid copy instances of the singleton. | |
GraphManager & | operator= (const GraphManager &graphManager)=delete |
GraphManager (GraphManager &&graphManager)=delete | |
GraphManager & | operator= (GraphManager &&graphManager)=delete |
Static Public Member Functions | |
static GraphManager & | getInstance () |
Returns a single instance of the GraphManager. | |
A templated wrapper around the Boost Graph Library (BGL).
Definition at line 51 of file GraphManager.h.
using GraphManager< VertexProperties >::EdgeDescriptor = typename boost::graph_traits<Graph>::edge_descriptor |
Definition at line 59 of file GraphManager.h.
using GraphManager< VertexProperties >::EdgeIterator = typename boost::graph_traits<Graph>::edge_iterator |
Definition at line 57 of file GraphManager.h.
using GraphManager< VertexProperties >::Graph |
Using directive for graphml graph type (adjacency list)
Definition at line 54 of file GraphManager.h.
using GraphManager< VertexProperties >::VertexIterator = typename boost::graph_traits<Graph>::vertex_iterator |
Definition at line 58 of file GraphManager.h.
pair< typename GraphManager< VertexProperties >::EdgeIterator, typename GraphManager< VertexProperties >::EdgeIterator > GraphManager< VertexProperties >::edges | ( | ) | const |
Exposes the BGL Edge Iterators of the stored Graph.
Retrieves the edges of the graph.
Definition at line 215 of file GraphManager.h.
const list< typename GraphManager< VertexProperties >::EdgeDescriptor > GraphManager< VertexProperties >::edgesSortByTarget | ( | ) | const |
Returns a list of EdgeDescriptors in ascending order by target vertexID.
Returns a list of EdgeDescriptors sorted by target vertexID.
Definition at line 272 of file GraphManager.h.
|
inlinestatic |
Returns a single instance of the GraphManager.
Definition at line 63 of file GraphManager.h.
size_t GraphManager< VertexProperties >::numEdges | ( | ) | const |
Retrieves the number of edges in the current graph.
Definition at line 297 of file GraphManager.h.
size_t GraphManager< VertexProperties >::numVertices | ( | ) | const |
Retrieves the number of vertices in the current graph.
Definition at line 290 of file GraphManager.h.
VertexProperties & GraphManager< VertexProperties >::operator[] | ( | size_t | vertex | ) |
Direct access to the VertexProperties of a vertex descriptor.
Directly access the VertexProperties of a vertex descriptor.
vertex | the vertex descriptor (index) |
vertex | The vertex descriptor (index). |
Definition at line 254 of file GraphManager.h.
const VertexProperties & GraphManager< VertexProperties >::operator[] | ( | size_t | vertex | ) | const |
Direct access to the VertexProperties of a vertex descriptor.
Directly access the VertexProperties of a vertex descriptor (const).
vertex | the vertex descriptor (index) |
vertex | The vertex descriptor (index). |
Definition at line 263 of file GraphManager.h.
bool GraphManager< VertexProperties >::readGraph | ( | ) |
Loads a graph from a graphml file into a BGL graph.
Reads a graph from a GraphML file into a BGL graph.
Definition at line 176 of file GraphManager.h.
|
inline |
Registers a graph property with its attribute name in the graphml file.
Note: We are passing a pointer to a data member of the Struct that will hold the property. The BGL will use this when loading the graphML file. Reference: https://www.studytonight.com/cpp/pointer-to-members.php
Property | Pointer to a Struct data member that will hold the property |
propName | The attribute name inthe graphml file |
property | Pointer to the property to be registered |
Definition at line 82 of file GraphManager.h.
void GraphManager< VertexProperties >::setFilePath | ( | string | filePath | ) |
Set the path for the graphML File to be read.
Sets the file path for the graphML file.
filePath | The absolute path to the graphML file |
filePath | The absolute path to the graphML file. |
Definition at line 169 of file GraphManager.h.
size_t GraphManager< VertexProperties >::source | ( | const EdgeDescriptor & | edge | ) | const |
Retrieves the source vertex index for the given Edge.
Retrieves the source vertex of a given edge.
edge | the EdgeDescriptor |
edge | The edge descriptor. |
Definition at line 224 of file GraphManager.h.
size_t GraphManager< VertexProperties >::target | ( | const EdgeDescriptor & | edge | ) | const |
Retrieves the target vertex index for the given Edge.
Retrieves the target vertex of a given edge.
edge | the EdgeDescriptor |
edge | The edge descriptor. |
Definition at line 234 of file GraphManager.h.
pair< typename GraphManager< VertexProperties >::VertexIterator, typename GraphManager< VertexProperties >::VertexIterator > GraphManager< VertexProperties >::vertices | ( | ) |
Exposes the BGL Vertex Iterators of the stored Graph.
Retrieves the vertices of the graph.
Definition at line 205 of file GraphManager.h.
double GraphManager< VertexProperties >::weight | ( | const EdgeDescriptor & | edge | ) | const |
Retrieves the weight of an edge.
edge | the EdgeDescriptor |
Definition at line 244 of file GraphManager.h.