joeq.Compiler.Dataflow
Class PriorityQueueSolver

java.lang.Object
  extended by joeq.Compiler.Dataflow.Solver
      extended by joeq.Compiler.Dataflow.WorklistSolver
          extended by joeq.Compiler.Dataflow.PriorityQueueSolver

public class PriorityQueueSolver
extends WorklistSolver

PriorityQueueSolver

Version:
$Id: PriorityQueueSolver.java 1931 2004-09-22 22:17:47Z joewhaley $
Author:
John Whaley

Field Summary
protected  Map nodesToPriorities
          Map from nodes to their (integer) priorities.
protected  jwutil.collections.MaxPriorityQueue worklist
          Priority-queue implementation of the worklist.
 
Fields inherited from class joeq.Compiler.Dataflow.WorklistSolver
boundaries, graphNavigator
 
Fields inherited from class joeq.Compiler.Dataflow.Solver
dataflowValues, factory, problem
 
Constructor Summary
PriorityQueueSolver()
           
PriorityQueueSolver(jwutil.collections.MapFactory f)
           
 
Method Summary
 Iterator allLocations()
          Returns an iteration of all graph locations.
protected  boolean hasNext()
          Returns true if the worklist is not empty, false otherwise.
 void initialize(Problem p, jwutil.graphs.Graph graph)
          Initializes the solver to prepare to solve the dataflow problem on the given graph.
 void initialize(Problem p, jwutil.graphs.Graph graph, List traversalOrder)
          Initializes this solver with the given dataflow problem, graph, and traversal order.
protected  void initializeTraversalOrder(List order)
           
protected  void initializeWorklist()
          (Re-)initialize the worklist.
protected  Object pull()
          Pull the next location off of the worklist.
protected  void pushAll(Collection c)
          Push all of the given locations onto the worklist.
 
Methods inherited from class joeq.Compiler.Dataflow.WorklistSolver
boundaryLocations, getPredecessors, getSuccessors, solve
 
Methods inherited from class joeq.Compiler.Dataflow.Solver
compareResults, direction, dumpResults, getDataflowValue, initializeDataflowValueMap, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodesToPriorities

protected Map nodesToPriorities
Map from nodes to their (integer) priorities.


worklist

protected jwutil.collections.MaxPriorityQueue worklist
Priority-queue implementation of the worklist.

Constructor Detail

PriorityQueueSolver

public PriorityQueueSolver(jwutil.collections.MapFactory f)

PriorityQueueSolver

public PriorityQueueSolver()
Method Detail

initialize

public void initialize(Problem p,
                       jwutil.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 WorklistSolver

initialize

public void initialize(Problem p,
                       jwutil.graphs.Graph graph,
                       List traversalOrder)
Initializes this solver with the given dataflow problem, graph, and traversal order.

See Also:
Solver.initialize(joeq.Compiler.Dataflow.Problem, jwutil.graphs.Graph)

initializeTraversalOrder

protected void initializeTraversalOrder(List order)

allLocations

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

Specified by:
allLocations in class Solver

initializeWorklist

protected void initializeWorklist()
Description copied from class: WorklistSolver
(Re-)initialize the worklist.

Specified by:
initializeWorklist in class WorklistSolver

hasNext

protected boolean hasNext()
Description copied from class: WorklistSolver
Returns true if the worklist is not empty, false otherwise.

Specified by:
hasNext in class WorklistSolver

pull

protected Object pull()
Description copied from class: WorklistSolver
Pull the next location off of the worklist.

Specified by:
pull in class WorklistSolver

pushAll

protected void pushAll(Collection c)
Description copied from class: WorklistSolver
Push all of the given locations onto the worklist.

Specified by:
pushAll in class WorklistSolver


Copyright © 2001-2008 John Whaley. All Rights Reserved.