るりまサーチ

最速Rubyリファレンスマニュアル検索!
129件ヒット [101-129件を表示] (0.065秒)

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

モジュール

検索結果

<< < 1 2 >>

TSort#each_strongly_connected_component -> Enumerator (31.0)

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

...each_strongly_connected_component は 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_component{|nodes|
p nodes
}

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

@
see TSort.each_strongly_connected_component...

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

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

...each_strongly_connected_component は 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_component{|nodes|
p nodes
}

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

@
see TSort.each_strongly_connected_component...

TSort#strongly_connected_components -> Array (31.0)

強連結成分の集まりを配列の配列として返します。 この配列は子から親に向かってソートされています。 各要素は強連結成分を表す配列です。

...使用例][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=>[]}

p non_sort.strongly_connected_components
#=> [[4], [2, 3], [1]]
//}

@
see TSort.s...
<< < 1 2 >>