graphlab.dense
Class DenseVertex

java.lang.Object
  extended by graphlab.Vertex
      extended by graphlab.dense.DenseVertex
Direct Known Subclasses:
ScalarVertex, ScalarVertex

public class DenseVertex
extends Vertex

Vertex with more compact data structure. Allows only float data in edges. Edge-objects are created on-the-fly.

Author:
akyrola Date: Dec 21, 2009

Field Summary
 
Fields inherited from class graphlab.Vertex
id
 
Constructor Summary
DenseVertex(DenseGraph graph, int estimatedInDegree, int estimatedOutDegree)
           
 
Method Summary
 int addIncomingEdge(int vertexId, float weight, float initialData)
          Adds an incoming edge with given weight and initial data
 void addOutgoingEdge(int vertexId, int indexAtDest)
           
 int[] getChildren()
           
 Edge getEdgeFrom(int fromVertexId)
           
 Edge getEdgeTo(int toVertexId)
          Returns edge directed to vertex toVertexId.
 java.util.List<Edge> getInboundEdges()
           
 java.util.List<Edge> getOutboundEdges()
           
 int[] getParents()
           
 void optimizeDataStructures()
           
 
Methods inherited from class graphlab.Vertex
getId, getVertexColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DenseVertex

public DenseVertex(DenseGraph graph,
                   int estimatedInDegree,
                   int estimatedOutDegree)
Method Detail

addIncomingEdge

public int addIncomingEdge(int vertexId,
                           float weight,
                           float initialData)
Adds an incoming edge with given weight and initial data

Parameters:
weight -
initialData -
Returns:
index of new edge's data in the data array of this vertex

addOutgoingEdge

public void addOutgoingEdge(int vertexId,
                            int indexAtDest)

optimizeDataStructures

public void optimizeDataStructures()

getInboundEdges

public java.util.List<Edge> getInboundEdges()
Overrides:
getInboundEdges in class Vertex
Returns:
unmodifiable list of inbound edges.

getOutboundEdges

public java.util.List<Edge> getOutboundEdges()
Overrides:
getOutboundEdges in class Vertex
Returns:
unmodifiable list of outbound edges

getEdgeTo

public Edge getEdgeTo(int toVertexId)
Description copied from class: Vertex
Returns edge directed to vertex toVertexId. Note: slow operation.

Overrides:
getEdgeTo in class Vertex

getEdgeFrom

public Edge getEdgeFrom(int fromVertexId)
Overrides:
getEdgeFrom in class Vertex

getChildren

public int[] getChildren()
Overrides:
getChildren in class Vertex
Returns:
list of child vertices (targets of outbound edges)

getParents

public int[] getParents()
Overrides:
getParents in class Vertex
Returns:
list of parent vertices (targets of inbound edges)