graphlab.dense
Class DenseVertex
java.lang.Object
graphlab.Vertex
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
| Fields inherited from class graphlab.Vertex |
id |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DenseVertex
public DenseVertex(DenseGraph graph,
int estimatedInDegree,
int estimatedOutDegree)
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)