154件ヒット
[101-154件を表示]
(0.146秒)
ライブラリ
- ビルトイン (24)
- pathname (22)
-
rexml
/ document (44) - tsort (64)
クラス
- Dir (24)
- Pathname (22)
-
REXML
:: Parent (44)
モジュール
- TSort (64)
キーワード
- each (34)
-
each
_ strongly _ connected _ component (21) -
each
_ strongly _ connected _ component _ from (21) -
strongly
_ connected _ components (11) - tsort (11)
検索結果
先頭5件
-
TSort
# strongly _ connected _ components -> Array (6113.0) -
強連結成分の集まりを配列の配列として返します。 この配列は子から親に向かってソートされています。 各要素は強連結成分を表す配列です。
...rt'
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.strongly_connected_components... -
REXML
:: Parent # each -> Enumerator (3003.0) -
各子ノードに対しブロックを呼び出します。
各子ノードに対しブロックを呼び出します。
ブロックを省略した場合は Enumerator を返します。 -
REXML
:: Parent # each {|object| . . . } -> () (3003.0) -
各子ノードに対しブロックを呼び出します。
各子ノードに対しブロックを呼び出します。
ブロックを省略した場合は Enumerator を返します。 -
Dir
# each -> Enumerator (13.0) -
ディレクトリの各エントリを表す文字列を引数として、ブロックを評価します。
...場合、各エントリを文字列として保持する
Enumerator
オブジェクトを返します。
@raise IOError 既に自身が close している場合に発生します。
//emlist[例][ruby]{
Dir.open('.').each{|f|
p f
}
#=> "."
# ".."
# "bar"
# "foo"
//}
@see Dir#each_child... -
Dir
# each {|item| . . . } -> self (13.0) -
ディレクトリの各エントリを表す文字列を引数として、ブロックを評価します。
...場合、各エントリを文字列として保持する
Enumerator
オブジェクトを返します。
@raise IOError 既に自身が close している場合に発生します。
//emlist[例][ruby]{
Dir.open('.').each{|f|
p f
}
#=> "."
# ".."
# "bar"
# "foo"
//}
@see Dir#each_child... -
TSort
# tsort -> Array (13.0) -
頂点をトポロジカルソートして得られる配列を返します。 この配列は子から親に向かってソートされています。 すなわち、最初の要素は子を持たず、最後の要素は親を持ちません。
...発生します。
//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
sorted = {1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort
p sorted #=> [3, 2, 1, 4]
//}
@see TSort.tsort...