|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.util.Stack<SortedGraphNode> org.jikesrvm.compilers.opt.util.TopSort
public final class TopSort
Depth First Spanning Tree, builds topological sort of a graph consisting of SortedGraphNode.
Field Summary | |
---|---|
private boolean |
forward
are we processing the graph in forward order? |
private SortedGraphNode |
lastNumberedNode
the last node to get a number |
private int |
sortMarker
the "visited" marker to use |
private int |
sortNumber
the next "number" to give out |
Constructor Summary | |
---|---|
private |
TopSort()
Prevent instantiation |
Method Summary | |
---|---|
static SortedGraphNode |
buildTopological(TopSortInterface graph,
boolean forward)
|
private void |
DFS(SortedGraphNode node,
int numNodes)
Depth-first numbering in a non-recursive manner |
Methods inherited from class org.jikesrvm.compilers.opt.util.Stack |
---|
compare, copy, empty, getTOS, isEmpty, iterator, peek, pop, push, shallowCopy, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int sortMarker
private int sortNumber
private SortedGraphNode lastNumberedNode
private boolean forward
Constructor Detail |
---|
private TopSort()
Method Detail |
---|
public static SortedGraphNode buildTopological(TopSortInterface graph, boolean forward)
graph
- the graphforward
- should we treat edges as forward?
This is the second version of the implementation
(see CVS file for older one)private void DFS(SortedGraphNode node, int numNodes)
node
- the root nodenumNodes
- the number of nodes in this graph
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |