Class FixedPointGraphTraversal<N,E>
java.lang.Object
com.google.javascript.jscomp.graph.FixedPointGraphTraversal<N,E>
- Type Parameters:
N- Value type that the graph node stores.E- Value type that the graph edge stores.
A utility class for doing fixed-point computations. We traverse
the edges over the given directed graph until the graph reaches
a steady state.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new traversal. -
Method Summary
Modifier and TypeMethodDescriptionvoidcomputeFixedPoint(DiGraph<N, E> graph) Compute a fixed point for the given graph.voidCompute a fixed point for the given graph, entering from the given nodes.voidcomputeFixedPoint(DiGraph<N, E> graph, N entry) Compute a fixed point for the given graph, entering from the given node.static <NODE,EDGE>
FixedPointGraphTraversal<NODE,EDGE> newTraversal(FixedPointGraphTraversal.EdgeCallback<NODE, EDGE> callback) Helper method for creating new traversals.
-
Field Details
-
NON_HALTING_ERROR_MSG
- See Also:
-
-
Constructor Details
-
FixedPointGraphTraversal
Create a new traversal.- Parameters:
callback- A callback for updating the state of the graph each time an edge is traversed.
-
-
Method Details
-
newTraversal
public static <NODE,EDGE> FixedPointGraphTraversal<NODE,EDGE> newTraversal(FixedPointGraphTraversal.EdgeCallback<NODE, EDGE> callback) Helper method for creating new traversals. -
computeFixedPoint
Compute a fixed point for the given graph.- Parameters:
graph- The graph to traverse.
-
computeFixedPoint
Compute a fixed point for the given graph, entering from the given node.- Parameters:
graph- The graph to traverse.entry- The node to begin traversing from.
-
computeFixedPoint
Compute a fixed point for the given graph, entering from the given nodes.- Parameters:
graph- The graph to traverse.entrySet- The nodes to begin traversing from.
-