Method: DAG.init
- Defined in:
- lib/zipf/dag.rb
.init(graph, semiring, source_node) ⇒ Object
initialize graph scores with semiring One
87 88 89 90 |
# File 'lib/zipf/dag.rb', line 87 def DAG::init graph, semiring, source_node graph.each {|n| n.score=semiring.null} source_node.score = semiring.one end |