Class: Hanuman::Graph

Inherits:
Stage
  • Object
show all
Includes:
TSort
Defined in:
lib/hanuman/graph.rb

Direct Known Subclasses

Wukong::Dataflow

Instance Method Summary collapse

Methods included from StageClassMethods

#builder, #label, #register, #set_builder

Instance Method Details

#directed_sortObject



16
# File 'lib/hanuman/graph.rb', line 16

def directed_sort() self.tsort ; end

#tsort_each_child(node, &blk) ⇒ Object



12
13
14
# File 'lib/hanuman/graph.rb', line 12

def tsort_each_child(node, &blk)
  links.select{ |link| link.into == node }.map(&:from).each(&blk)
end

#tsort_each_node(&blk) ⇒ Object



8
9
10
# File 'lib/hanuman/graph.rb', line 8

def tsort_each_node(&blk)
  stages.keys.each(&blk)
end