Dataflow Software Stack  032db78
Master Thesis of Mathijs Saey at the VUB
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
IGR.subgraph.SubGraph Class Reference

SubGraph. More...

Inherits object.

Public Member Functions

def __init__
 
def __str__
 Printable subgraph. More...
 
def getOutputPort
 Get an output port of the subgraph. More...
 
def getInputPort
 Gets an input port of the subgraph. More...
 
def addNode
 Add a node to the node list of the subgraph. More...
 
def isTrivial
 See if a graph can be reduced to a constant value. More...
 
def reduce
 Attach a constant to a subgraph. More...
 
def removeNode
 Remove a node. More...
 
def replaceNode
 Replace a node. More...
 

Public Attributes

 name
 
 entry
 
 exit
 
 nodes
 
 value
 
 isFunc
 

Detailed Description

SubGraph.

An IGR subgraph is either a function body, or a part of the compound node.

Constructor & Destructor Documentation

def IGR.subgraph.SubGraph.__init__ (   self,
  entry,
  exit,
  name,
  isFunc 
)

Member Function Documentation

def IGR.subgraph.SubGraph.__str__ (   self)

Printable subgraph.

def IGR.subgraph.SubGraph.getOutputPort (   self,
  idx 
)

Get an output port of the subgraph.

This maps to the ports of the entry node.

This may seem counterintuitive, but this is seen from the perspective of the inside of the subgraph. In which case the output port is used to retrieve data from the subgraph.

def IGR.subgraph.SubGraph.getInputPort (   self,
  idx 
)

Gets an input port of the subgraph.

This maps to the input of the return (exit) node.

Once again this is seen from the inside of the subgraph. If we want to add data to the subgraph, we try to return it to the outside world, which is done through the exit node.

def IGR.subgraph.SubGraph.addNode (   self,
  node 
)

Add a node to the node list of the subgraph.

def IGR.subgraph.SubGraph.isTrivial (   self)

See if a graph can be reduced to a constant value.

def IGR.subgraph.SubGraph.reduce (   self,
  value 
)

Attach a constant to a subgraph.

def IGR.subgraph.SubGraph.removeNode (   self,
  node 
)

Remove a node.

This only removes the node from the node list. It does not clean up any edges possibly leading to the node.

It silently fails if the node does not exist.

def IGR.subgraph.SubGraph.replaceNode (   self,
  node,
  new 
)

Replace a node.

This replaces a node in the node list of the subgraph by new. All of the in and output ports of the node are added to new.

Member Data Documentation

IGR.subgraph.SubGraph.name
IGR.subgraph.SubGraph.entry
IGR.subgraph.SubGraph.exit
IGR.subgraph.SubGraph.nodes
IGR.subgraph.SubGraph.value
IGR.subgraph.SubGraph.isFunc