るりまサーチ

最速Rubyリファレンスマニュアル検索!
53件ヒット [1-53件を表示] (0.484秒)
トップページ > クエリ:nil[x] > クエリ:each_child[x] > クエリ:each_strongly_connected_component[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

モジュール

検索結果

TSort.each_strongly_connected_component(each_node, each_child) {|nodes| ...} -> nil (18359.0)

TSort.strongly_connected_components メソッドのイテレータ版です。

...レータ版です。

引数 each_node と each_child でグラフを表します。

@param each_node グラフ上の頂点をそれぞれ評価するcallメソッドを持つオブ
ジェクトを指定します。

@param each_child 引数で与えられた頂点の子をそれ...
...a {|&b| g.each_key(&b) }
each_child
= lambda {|n, &b| g[n].each(&b) }
TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc }

# => [4]
# [2]
# [3]
# [1]

g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
each_node = lambda {|&b| g.each_key(&b) }
each_child
= lambda {|n, &b| g[n]...
....each(&b) }
TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc }

# => [4]
# [2, 3]
# [1]
//}

@see TSort#each_strongly_connected_component...

TSort.each_strongly_connected_component(each_node, each_child) -> Enumerator (18259.0)

TSort.strongly_connected_components メソッドのイテレータ版です。

...レータ版です。

引数 each_node と each_child でグラフを表します。

@param each_node グラフ上の頂点をそれぞれ評価するcallメソッドを持つオブ
ジェクトを指定します。

@param each_child 引数で与えられた頂点の子をそれ...
...a {|&b| g.each_key(&b) }
each_child
= lambda {|n, &b| g[n].each(&b) }
TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc }

# => [4]
# [2]
# [3]
# [1]

g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
each_node = lambda {|&b| g.each_key(&b) }
each_child
= lambda {|n, &b| g[n]...
....each(&b) }
TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc }

# => [4]
# [2, 3]
# [1]
//}

@see TSort#each_strongly_connected_component...

TSort#each_strongly_connected_component {|nodes| ...} -> nil (18249.0)

TSort#strongly_connected_components メソッドのイテレータ版です。 obj.each_strongly_connected_component は obj.strongly_connected_components.each に似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。

...タ版です。
obj.each_strongly_connected_component
obj.strongly_connected_components.each に似ていますが、
ブロックの評価中に obj が変更された場合は予期しない結果になる
ことがあります。

each_strongly_connected_component
nil を返します。...
...tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}

non_sort.each_strongly_connected_component{|nodes|
p nodes
}

#出力
#=> [4]
#=> [2, 3]
#=> [1]
//}

@see TSort.each_strongly_connected_component...

TSort#each_strongly_connected_component -> Enumerator (18149.0)

TSort#strongly_connected_components メソッドのイテレータ版です。 obj.each_strongly_connected_component は obj.strongly_connected_components.each に似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。

...タ版です。
obj.each_strongly_connected_component
obj.strongly_connected_components.each に似ていますが、
ブロックの評価中に obj が変更された場合は予期しない結果になる
ことがあります。

each_strongly_connected_component
nil を返します。...
...tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}

non_sort.each_strongly_connected_component{|nodes|
p nodes
}

#出力
#=> [4]
#=> [2, 3]
#=> [1]
//}

@see TSort.each_strongly_connected_component...

tsort (42.0)

tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。

...を提供します。

=== Example

//emlist[][ruby]{
require 'tsort'

class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

{1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort
#=> [3, 2, 1, 4]

{1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}...
...triple = [outputs, inputs, block]
outputs.each {|f| @dep[f] = [triple]}
@dep[triple] = inputs
end

def build(target)
each_strongly_connected_component
_from(target) {|ns|
if ns.length != 1
fs = ns.delete_if {|n| Array === n}
raise TSort::Cyclic.new("cyclic dep...
...outputs_time = nil
end
if outputs_time == nil ||
inputs_time != nil && outputs_time <= inputs_time
sleep 1 if inputs_time != nil && inputs_time.to_i == Time.now.to_i
block.call
end
end
}
end

def tsort_each_child(node, &block)...

絞り込み条件を変える