galois.objects.graph
Interface LongGraph<N extends GObject>

Type Parameters:
N - the type of the object stored in each node
All Superinterfaces:
GObject, Graph<N>, Mappable<GNode<N>>

public interface LongGraph<N extends GObject>
extends Graph<N>

Interface used to represent graphs whose edges contain long data.
Edges can be created only by invoking ObjectGraph.addEdge(galois.objects.graph.GNode, galois.objects.graph.GNode, E): invocations of Graph.addNeighbor(GNode, GNode) will result in a exception, because no edge data has been specified.


Method Summary
 boolean addEdge(GNode<N> src, GNode<N> dst, long data)
          Adds an edge to the graph containing the specified data.
 boolean addEdge(GNode<N> src, GNode<N> dst, long data, byte flags)
          Adds an edge to the graph containing the specified data.
 long getEdgeData(GNode<N> src, GNode<N> dst)
          Retrieves the data associated with an edge.
 long getEdgeData(GNode<N> src, GNode<N> dst, byte flags)
          Retrieves the data associated with an edge.
 long setEdgeData(GNode<N> src, GNode<N> dst, long d)
          Sets the data associated with an edge.
 long setEdgeData(GNode<N> src, GNode<N> dst, long d, byte flags)
          Sets the data associated with an edge.
 
Methods inherited from interface galois.objects.graph.Graph
add, add, addNeighbor, addNeighbor, contains, contains, createNode, createNode, hasNeighbor, hasNeighbor, inNeighborsSize, inNeighborsSize, isDirected, mapInNeighbors, mapInNeighbors, outNeighborsSize, outNeighborsSize, remove, remove, removeNeighbor, removeNeighbor, size, size
 
Methods inherited from interface galois.objects.Mappable
map, map, map, map, map, map, mapInternal, mapInternal, mapInternal, mapInternalDone
 
Methods inherited from interface galois.objects.GObject
access
 

Method Detail

addEdge

boolean addEdge(GNode<N> src,
                GNode<N> dst,
                long data)
Adds an edge to the graph containing the specified data.

All the Galois runtime actions (e.g., conflict detection) will be performed when the method is executed.

Parameters:
src - the source node of the edge
dst - the destination node of the edge
data - information to be stored in the new edge
Returns:
true if there was no previous edge between the two nodes

addEdge

boolean addEdge(GNode<N> src,
                GNode<N> dst,
                long data,
                byte flags)
Adds an edge to the graph containing the specified data.

Parameters:
src - the source node of the edge
dst - the destination node of the edge
data - information to be stored in the new edge
flags - Galois runtime actions (e.g., conflict detection) that need to be executed upon invocation of this method. See MethodFlag
Returns:
true if there was no previous edge between the two nodes

getEdgeData

long getEdgeData(GNode<N> src,
                 GNode<N> dst)
Retrieves the data associated with an edge.

Be aware that this method will return -1 in two cases:

In order to distinguish between the two cases, use Graph.hasNeighbor(GNode, GNode)

All the Galois runtime actions (e.g., conflict detection) will be performed when the method is executed.

Parameters:
src - the source node of the edge
dst - the destination node of the edge
Returns:
the data associated with the edge, or -1 if the edge does not exist

getEdgeData

long getEdgeData(GNode<N> src,
                 GNode<N> dst,
                 byte flags)
Retrieves the data associated with an edge.

Be aware that this method will return -1 in two cases:

In order to distinguish between the two cases, use Graph.hasNeighbor(GNode, GNode)

Parameters:
src - the source node of the edge
dst - the destination node of the edge
flags - Galois runtime actions (e.g., conflict detection) that need to be executed upon invocation of this method. See MethodFlag
Returns:
the data associated with the edge, or -1 if the edge does not exist

setEdgeData

long setEdgeData(GNode<N> src,
                 GNode<N> dst,
                 long d)
Sets the data associated with an edge.

All the Galois runtime actions (e.g., conflict detection) will be performed when the method is executed.

Parameters:
src - the source node of the edge
dst - the destination node of the edge
d - the data to associate with the edge
Returns:
the data previously associated with the edge, or -1 if the edge does not exist

setEdgeData

long setEdgeData(GNode<N> src,
                 GNode<N> dst,
                 long d,
                 byte flags)
Sets the data associated with an edge.

Parameters:
src - the source node of the edge
dst - the destination node of the edge
d - the data to associate with the edge
flags - Galois runtime actions (e.g., conflict detection) that need to be executed upon invocation of this method. See MethodFlag
Returns:
the data previously associated with the edge, or -1 if the edge does not exist