de.cau.cs.kieler.krep.compiler.dependencies
Class DepGraph

java.lang.Object
  extended by de.cau.cs.kieler.krep.compiler.dependencies.DepGraph

public class DepGraph
extends Object

Dependency graph of the dataflow program.

Rating yellow
(2010-02-05) review by cmot, msp, tam

Constructor Summary
DepGraph(HashMap<String,LinkedList<String>> eqs)
          generate dependency graph for the program.
 
Method Summary
 void add(String s, String t)
          add a new dependency from s to t.
 void addSubGraph(String name, DepGraph d)
           
 int getMaxPrio()
           
 int getPrio(String name)
           
 List<String> sort()
           
 void split(int n)
          Cluster all nodes, cluster 0 are inputs, cluster n are outputs.
 String toDot(boolean printHeader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DepGraph

public DepGraph(HashMap<String,LinkedList<String>> eqs)
generate dependency graph for the program.

Parameters:
eqs - equations of the program
Method Detail

add

public void add(String s,
                String t)
add a new dependency from s to t.

Parameters:
s - source of the dependency
t - target of the dependency

sort

public List<String> sort()
Returns:
sorted list of the variables, that respects all dependencies

split

public void split(int n)
Cluster all nodes, cluster 0 are inputs, cluster n are outputs.

Parameters:
n - number of clusters

toDot

public String toDot(boolean printHeader)
Parameters:
printHeader - print initialization code?
Returns:
description of the dependency graph in the dot-format

getPrio

public int getPrio(String name)
Parameters:
name - of a node
Returns:
priority of that node

getMaxPrio

public int getMaxPrio()
Returns:
maximal used priority

addSubGraph

public void addSubGraph(String name,
                        DepGraph d)
Parameters:
name - name of the subgraph
d - a dependency graph that is added