|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.graph.ConstUndirGraph
peersim.graph.FastUndirGraph
public class FastUndirGraph
Speeds up ConstUndirGraph.isEdge(int, int)
by storing the links in an
adjacency matrix (in fact in a triangle).
Its memory consumption is huge but it's much faster if the isEdge method
of the original underlying graph is slow.
Field Summary |
---|
Fields inherited from class peersim.graph.ConstUndirGraph |
---|
g, in |
Constructor Summary | |
---|---|
FastUndirGraph(Graph graph)
Calls super constructor |
Method Summary | |
---|---|
protected void |
initGraph()
Finds and stores incoming edges |
boolean |
isEdge(int i,
int j)
Returns true if there is a directed edge between node i and node j. |
Methods inherited from class peersim.graph.ConstUndirGraph |
---|
clearEdge, degree, directed, getEdge, getNeighbours, getNode, setEdge, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FastUndirGraph(Graph graph)
Method Detail |
---|
protected void initGraph()
ConstUndirGraph
initGraph
in class ConstUndirGraph
public boolean isEdge(int i, int j)
Graph
isEdge
in interface Graph
isEdge
in class ConstUndirGraph
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |