Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Compil3r.Dataflow
Class IterativeSolver  view IterativeSolver download IterativeSolver.java

java.lang.Object
  extended byCompil3r.Dataflow.Solver
      extended byCompil3r.Dataflow.IterativeSolver

public class IterativeSolver
extends Solver

Solves a dataflow problem using a iterative technique. Successively iterates over the locations in the graph in a given order until there are no more changes.

Version:
$Id: IterativeSolver.java,v 1.1 2003/06/17 02:37:51 joewhaley Exp $

Field Summary
protected  java.util.Collection boundaries
          The boundary locations.
protected  boolean change
          Change flag, set to true if we need to iterate more times.
protected  Util.Graphs.Navigator graphNavigator
          Navigator to navigate the graph of locations.
static boolean TRACE
           
protected  java.util.List traversalOrder
          The order in which the locations are to be traversed.
 
Fields inherited from class Compil3r.Dataflow.Solver
dataflowValues, factory, problem
 
Constructor Summary
IterativeSolver()
           
IterativeSolver(Util.Collections.MapFactory f)
           
 
Method Summary
 java.util.Iterator allLocations()
          Returns an iteration of all graph locations.
 java.util.Iterator boundaryLocations()
          Returns an iteration of all boundary locations.
protected  java.util.Collection getPredecessors(java.lang.Object c)
          Get the predecessor locations of the given location.
protected  java.util.Collection getSuccessors(java.lang.Object c)
          Get the successor locations of the given location.
protected  java.util.Iterator getTraversalOrder()
          Returns an iteration of the order in which the locations are to be traversed.
 void initialize(Problem p, Util.Graphs.Graph graph)
          Initializes the solver to prepare to solve the dataflow problem on the given graph.
 void initialize(Problem p, Util.Graphs.Graph graph, java.util.List order)
          Initializes this solver with the given dataflow problem, graph, and traversal order.
 void solve()
          Solves this dataflow problem.
 
Methods inherited from class Compil3r.Dataflow.Solver
direction, getDataflowValue, initializeDataflowValueMap, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

traversalOrder

protected java.util.List traversalOrder
The order in which the locations are to be traversed.


boundaries

protected java.util.Collection boundaries
The boundary locations.


graphNavigator

protected Util.Graphs.Navigator graphNavigator
Navigator to navigate the graph of locations.


change

protected boolean change
Change flag, set to true if we need to iterate more times.


TRACE

public static final boolean TRACE
See Also:
Constant Field Values
Constructor Detail

IterativeSolver

public IterativeSolver(Util.Collections.MapFactory f)

IterativeSolver

public IterativeSolver()
Method Detail

getTraversalOrder

protected java.util.Iterator getTraversalOrder()
Returns an iteration of the order in which the locations are to be traversed.


getPredecessors

protected java.util.Collection getPredecessors(java.lang.Object c)
Get the predecessor locations of the given location.


getSuccessors

protected java.util.Collection getSuccessors(java.lang.Object c)
Get the successor locations of the given location.


initialize

public void initialize(Problem p,
                       Util.Graphs.Graph graph)
Description copied from class: Solver
Initializes the solver to prepare to solve the dataflow problem on the given graph.

Overrides:
initialize in class Solver

initialize

public void initialize(Problem p,
                       Util.Graphs.Graph graph,
                       java.util.List order)
Initializes this solver with the given dataflow problem, graph, and traversal order.


allLocations

public java.util.Iterator allLocations()
Description copied from class: Solver
Returns an iteration of all graph locations.

Specified by:
allLocations in class Solver

boundaryLocations

public java.util.Iterator boundaryLocations()
Description copied from class: Solver
Returns an iteration of all boundary locations.

Specified by:
boundaryLocations in class Solver

solve

public void solve()
Description copied from class: Solver
Solves this dataflow problem.

Specified by:
solve in class Solver