#include <Graph.h>
Classes | |
struct | gNode |
class | GraphNode |
An opaque handle to a graph node. More... | |
class | makeGraphNode |
class | makeGraphNodePtr |
Public Types | |
typedef VoidWrapper< EdgeTy > ::ref_type | edge_reference |
A reference to an edge. | |
typedef VoidWrapper< EdgeTy > ::const_ref_type | const_edge_reference |
A reference to a const edge. | |
typedef VoidWrapper< NodeTy > ::ref_type | node_reference |
A reference to a node. | |
typedef VoidWrapper< NodeTy > ::const_ref_type | const_node_reference |
A reference to a const node. | |
typedef EdgeTy | EdgeDataTy |
typedef NodeTy | NodeDataTy |
typedef boost::transform_iterator < makeGraphNodePtr, typename gNode::neighbor_iterator > | neighbor_iterator |
typedef boost::transform_iterator < makeGraphNode, boost::filter_iterator < std::mem_fun_ref_t< bool, gNode >, typename NodeListTy::iterator > > | active_iterator |
Public Member Functions | |
GraphNode | createNode (const_node_reference n) |
Creates a new node holding the indicated data. | |
bool | addNode (const GraphNode &n, Galois::MethodFlag mflag=ALL) |
Adds a node to the graph. | |
bool | addNode (const GraphNode &n, int maxDegree, MethodFlag mflag=ALL) |
node_reference | getData (const GraphNode &n, Galois::MethodFlag mflag=ALL) const |
Gets the node data for a node. | |
bool | containsNode (const GraphNode &n) const |
Checks if a node is in the graph (already added). | |
bool | removeNode (GraphNode n, Galois::MethodFlag mflag=ALL) |
Removes a node from the graph along with all its outgoing/incoming edges for undirected graphs or outgoing edges for directed graphs. | |
void | addEdge (GraphNode src, GraphNode dst, const_edge_reference data, Galois::MethodFlag mflag=ALL) |
Adds an edge to the graph containing the specified data. | |
void | addEdge (GraphNode src, GraphNode dst, Galois::MethodFlag mflag=ALL) |
Adds an edge to the graph. | |
void | removeEdge (GraphNode src, GraphNode dst, Galois::MethodFlag mflag=ALL) |
Removes an edge from the graph. | |
edge_reference | getEdgeData (GraphNode src, GraphNode dst, Galois::MethodFlag mflag=ALL) const |
Returns the edge data associated with the edge. | |
edge_reference | getOrCreateEdge (GraphNode src, GraphNode dst, const_edge_reference data, Galois::MethodFlag mflag=ALL) const |
Returns the edge data associated with the edge if the edge exists, otherwise it add an edge with the given edge data for a non-existent edge. | |
int | neighborsSize (GraphNode N, Galois::MethodFlag mflag=ALL) const |
Returns the number of neighbors. | |
neighbor_iterator | neighbor_begin (GraphNode N, Galois::MethodFlag mflag=ALL) |
Returns an iterator to the neighbors of a node. | |
neighbor_iterator | neighbor_end (GraphNode N, Galois::MethodFlag mflag=ALL) |
Returns the end of the neighbor iterator. | |
edge_reference | getEdgeData (GraphNode src, neighbor_iterator dst, Galois::MethodFlag mflag=ALL) |
active_iterator | active_begin () |
Returns an iterator to all the nodes in the graph. | |
active_iterator | active_end () |
Returns the end of the node iterator. Not thread-safe. | |
unsigned int | size () |
Returns the number of nodes in the graph. | |
FirstGraph () | |
Private Types | |
typedef GaloisRuntime::galois_insert_bag < gNode > | NodeListTy |
Private Member Functions | |
node_reference | getData (gNode *ID, Galois::MethodFlag mflag=ALL) |
Private Attributes | |
NodeListTy | nodes |
A Graph.
NodeTy | Type of node data | |
EdgeTy | Type of edge data | |
Directional | true if graph is directed |
typedef boost::transform_iterator<makeGraphNode, boost::filter_iterator<std::mem_fun_ref_t<bool, gNode>, typename NodeListTy::iterator> > Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::active_iterator |
typedef VoidWrapper<EdgeTy>::const_ref_type Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::const_edge_reference |
A reference to a const edge.
typedef VoidWrapper<NodeTy>::const_ref_type Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::const_node_reference |
A reference to a const node.
typedef VoidWrapper<EdgeTy>::ref_type Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::edge_reference |
A reference to an edge.
typedef EdgeTy Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::EdgeDataTy |
typedef boost::transform_iterator<makeGraphNodePtr, typename gNode::neighbor_iterator> Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::neighbor_iterator |
typedef VoidWrapper<NodeTy>::ref_type Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::node_reference |
A reference to a node.
typedef NodeTy Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::NodeDataTy |
typedef GaloisRuntime::galois_insert_bag<gNode> Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::NodeListTy [private] |
Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::FirstGraph | ( | ) | [inline] |
active_iterator Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::active_begin | ( | ) | [inline] |
Returns an iterator to all the nodes in the graph.
Not thread-safe.
active_iterator Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::active_end | ( | ) | [inline] |
Returns the end of the node iterator. Not thread-safe.
void Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::addEdge | ( | GraphNode | src, | |
GraphNode | dst, | |||
Galois::MethodFlag | mflag = ALL | |||
) | [inline] |
Adds an edge to the graph.
void Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::addEdge | ( | GraphNode | src, | |
GraphNode | dst, | |||
const_edge_reference | data, | |||
Galois::MethodFlag | mflag = ALL | |||
) | [inline] |
Adds an edge to the graph containing the specified data.
bool Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::addNode | ( | const GraphNode & | n, | |
int | maxDegree, | |||
MethodFlag | mflag = ALL | |||
) | [inline] |
bool Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::addNode | ( | const GraphNode & | n, | |
Galois::MethodFlag | mflag = ALL | |||
) | [inline] |
Adds a node to the graph.
bool Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::containsNode | ( | const GraphNode & | n | ) | const [inline] |
Checks if a node is in the graph (already added).
GraphNode Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::createNode | ( | const_node_reference | n | ) | [inline] |
Creates a new node holding the indicated data.
The node is not added to the graph (see addNode() instead). For graphs with void node data, pass GraphUnit instead.
node_reference Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::getData | ( | const GraphNode & | n, | |
Galois::MethodFlag | mflag = ALL | |||
) | const [inline] |
Gets the node data for a node.
node_reference Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::getData | ( | gNode * | ID, | |
Galois::MethodFlag | mflag = ALL | |||
) | [inline, private] |
edge_reference Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::getEdgeData | ( | GraphNode | src, | |
neighbor_iterator | dst, | |||
Galois::MethodFlag | mflag = ALL | |||
) | [inline] |
edge_reference Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::getEdgeData | ( | GraphNode | src, | |
GraphNode | dst, | |||
Galois::MethodFlag | mflag = ALL | |||
) | const [inline] |
Returns the edge data associated with the edge.
It is an error to get the edge data for a non-existent edge.
edge_reference Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::getOrCreateEdge | ( | GraphNode | src, | |
GraphNode | dst, | |||
const_edge_reference | data, | |||
Galois::MethodFlag | mflag = ALL | |||
) | const [inline] |
Returns the edge data associated with the edge if the edge exists, otherwise it add an edge with the given edge data for a non-existent edge.
neighbor_iterator Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::neighbor_begin | ( | GraphNode | N, | |
Galois::MethodFlag | mflag = ALL | |||
) | [inline] |
Returns an iterator to the neighbors of a node.
neighbor_iterator Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::neighbor_end | ( | GraphNode | N, | |
Galois::MethodFlag | mflag = ALL | |||
) | [inline] |
Returns the end of the neighbor iterator.
int Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::neighborsSize | ( | GraphNode | N, | |
Galois::MethodFlag | mflag = ALL | |||
) | const [inline] |
Returns the number of neighbors.
void Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::removeEdge | ( | GraphNode | src, | |
GraphNode | dst, | |||
Galois::MethodFlag | mflag = ALL | |||
) | [inline] |
Removes an edge from the graph.
bool Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::removeNode | ( | GraphNode | n, | |
Galois::MethodFlag | mflag = ALL | |||
) | [inline] |
Removes a node from the graph along with all its outgoing/incoming edges for undirected graphs or outgoing edges for directed graphs.
unsigned int Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::size | ( | ) | [inline] |
Returns the number of nodes in the graph.
Not thread-safe.
NodeListTy Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::nodes [private] |