るりまサーチ

最速Rubyリファレンスマニュアル検索!
42件ヒット [1-42件を表示] (0.455秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:p[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 -> Enumerator (24243.0)

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

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

//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

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

non_sort.each_strongly_connected_comp...
...onent{|nodes|
p
nodes
}

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

@see TSort.each_strongly_connected_component...

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

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

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

//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

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

non_sort.each_strongly_connected_comp...
...onent{|nodes|
p
nodes
}

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

@see TSort.each_strongly_connected_component...

TSort#each_strongly_connected_component_from(node, id_map={}, stack=[]) -> Enumerator (12233.0)

node から到達可能な強連結成分についてのイテレータです。

...可能な強連結成分についてのイテレータです。

返す値は規定されていません。

each_strongly_connected_component
_from は
tsort_each_node を呼びません。

@param node ノードを指定します。

//emlist[例 到達可能なノードを表示する][ruby]{
requ...
...ach(&block)
end
end

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

non_sort.each_strongly_connected_component{|nodes|
p
nodes
nodes.each {|node|
non_sort.each_strongly_connected_component_from(node){|ns|
p
rintf("%s -> %s\n", node, ns.join(","))
}
}
}

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

@see TSort.each_strongly_connected_component_from...

TSort#each_strongly_connected_component_from(node, id_map={}, stack=[]) {|nodes| ...} -> () (12233.0)

node から到達可能な強連結成分についてのイテレータです。

...可能な強連結成分についてのイテレータです。

返す値は規定されていません。

each_strongly_connected_component
_from は
tsort_each_node を呼びません。

@param node ノードを指定します。

//emlist[例 到達可能なノードを表示する][ruby]{
requ...
...ach(&block)
end
end

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

non_sort.each_strongly_connected_component{|nodes|
p
nodes
nodes.each {|node|
non_sort.each_strongly_connected_component_from(node){|ns|
p
rintf("%s -> %s\n", node, ns.join(","))
}
}
}

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

@see TSort.each_strongly_connected_component_from...