Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional > Class Template Reference

A Graph. More...

#include <Graph.h>

List of all members.

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

Detailed Description

template<typename NodeTy, typename EdgeTy, bool Directional>
class Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >

A Graph.

Parameters:
NodeTy Type of node data
EdgeTy Type of edge data
Directional true if graph is directed

Member Typedef Documentation

template<typename NodeTy , typename EdgeTy , bool Directional>
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
template<typename NodeTy , typename EdgeTy , bool Directional>
typedef VoidWrapper<EdgeTy>::const_ref_type Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::const_edge_reference

A reference to a const edge.

template<typename NodeTy , typename EdgeTy , bool Directional>
typedef VoidWrapper<NodeTy>::const_ref_type Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::const_node_reference

A reference to a const node.

template<typename NodeTy , typename EdgeTy , bool Directional>
typedef VoidWrapper<EdgeTy>::ref_type Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::edge_reference

A reference to an edge.

template<typename NodeTy , typename EdgeTy , bool Directional>
typedef EdgeTy Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::EdgeDataTy
template<typename NodeTy , typename EdgeTy , bool Directional>
typedef boost::transform_iterator<makeGraphNodePtr, typename gNode::neighbor_iterator> Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::neighbor_iterator
template<typename NodeTy , typename EdgeTy , bool Directional>
typedef VoidWrapper<NodeTy>::ref_type Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::node_reference

A reference to a node.

template<typename NodeTy , typename EdgeTy , bool Directional>
typedef NodeTy Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::NodeDataTy
template<typename NodeTy , typename EdgeTy , bool Directional>
typedef GaloisRuntime::galois_insert_bag<gNode> Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::NodeListTy [private]

Constructor & Destructor Documentation

template<typename NodeTy , typename EdgeTy , bool Directional>
Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::FirstGraph (  )  [inline]

Member Function Documentation

template<typename NodeTy , typename EdgeTy , bool Directional>
active_iterator Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::active_begin (  )  [inline]

Returns an iterator to all the nodes in the graph.

Not thread-safe.

template<typename NodeTy , typename EdgeTy , bool Directional>
active_iterator Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::active_end (  )  [inline]

Returns the end of the node iterator. Not thread-safe.

template<typename NodeTy , typename EdgeTy , bool Directional>
void Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::addEdge ( GraphNode  src,
GraphNode  dst,
Galois::MethodFlag  mflag = ALL 
) [inline]

Adds an edge to the graph.

template<typename NodeTy , typename EdgeTy , bool Directional>
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.

template<typename NodeTy , typename EdgeTy , bool Directional>
bool Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::addNode ( const GraphNode n,
int  maxDegree,
MethodFlag  mflag = ALL 
) [inline]
template<typename NodeTy , typename EdgeTy , bool Directional>
bool Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::addNode ( const GraphNode n,
Galois::MethodFlag  mflag = ALL 
) [inline]

Adds a node to the graph.

template<typename NodeTy , typename EdgeTy , bool Directional>
bool Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::containsNode ( const GraphNode n  )  const [inline]

Checks if a node is in the graph (already added).

template<typename NodeTy , typename EdgeTy , bool Directional>
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.

template<typename NodeTy , typename EdgeTy , bool Directional>
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.

template<typename NodeTy , typename EdgeTy , bool Directional>
node_reference Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::getData ( gNode ID,
Galois::MethodFlag  mflag = ALL 
) [inline, private]
template<typename NodeTy , typename EdgeTy , bool Directional>
edge_reference Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::getEdgeData ( GraphNode  src,
neighbor_iterator  dst,
Galois::MethodFlag  mflag = ALL 
) [inline]
template<typename NodeTy , typename EdgeTy , bool Directional>
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.

template<typename NodeTy , typename EdgeTy , bool Directional>
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.

template<typename NodeTy , typename EdgeTy , bool Directional>
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.

template<typename NodeTy , typename EdgeTy , bool Directional>
neighbor_iterator Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::neighbor_end ( GraphNode  N,
Galois::MethodFlag  mflag = ALL 
) [inline]

Returns the end of the neighbor iterator.

template<typename NodeTy , typename EdgeTy , bool Directional>
int Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::neighborsSize ( GraphNode  N,
Galois::MethodFlag  mflag = ALL 
) const [inline]

Returns the number of neighbors.

template<typename NodeTy , typename EdgeTy , bool Directional>
void Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::removeEdge ( GraphNode  src,
GraphNode  dst,
Galois::MethodFlag  mflag = ALL 
) [inline]

Removes an edge from the graph.

template<typename NodeTy , typename EdgeTy , bool Directional>
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.

template<typename NodeTy , typename EdgeTy , bool Directional>
unsigned int Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::size (  )  [inline]

Returns the number of nodes in the graph.

Not thread-safe.


Member Data Documentation

template<typename NodeTy , typename EdgeTy , bool Directional>
NodeListTy Galois::Graph::FirstGraph< NodeTy, EdgeTy, Directional >::nodes [private]

The documentation for this class was generated from the following file:
Generated on Tue Aug 2 11:51:30 2011 for Galois by  doxygen 1.6.3