るりまサーチ

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

別のキーワード

  1. matrix map
  2. _builtin map
  3. matrix map!
  4. _builtin flat_map
  5. set map!

ライブラリ

モジュール

検索結果

tsort (38094.0)

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

...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],...
...3], 3=>[], 4=>[]}.tsort
#=> [3, 2, 1, 4]

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

=== より現実的な例

非常に単純な `make' に似たツールは以下のように実装できます。

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

class Make
de...
...rray === n}
raise TSort::Cyclic.new("cyclic dependencies: #{fs.join ', '}")
end
n = ns.first
if Array === n
outputs, inputs, block = n
inputs_time = inputs.map {|f| File.mtime f}.max
begin
outputs_time = outputs.map {|f| File.mtime f}.min...

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

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

...mponent_from は
tsort
_each_node を呼びません。

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

//emlist[例 到達可能なノードを表示する][ruby]{
require 'tsort'

class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch
(node).each(&blo...
...sort.each_strongly_connected_component_from(node){|ns|
printf("%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| ...} -> () (17144.0)

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

...mponent_from は
tsort
_each_node を呼びません。

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

//emlist[例 到達可能なノードを表示する][ruby]{
require 'tsort'

class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch
(node).each(&blo...
...sort.each_strongly_connected_component_from(node){|ns|
printf("%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...

1.6.8から1.8.0への変更点(まとめ) (42.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...|Array/transpose>)) [new]

追加

: ((<Array#zip|Enumerable/zip>)) [new]
: ((<Enumerable#zip|Enumerable/zip>)) [new]

追加

: ((<Array#fetch|Array/fetch>)) [new]

追加

: ((<Array#insert|Array/insert>)) [new]

追加 ((<ruby-talk:14289>))

(({ary[n,0] = [other,...]})) と同...
...ll("KILL", pid) とは
できないようです・・・2002-08-28 その後 "KILL" で指定できるようになっ
たようです)

: win32: map OS error to errno. [change]

: cygwin

cygwinでは常にバイナリモードになりました(((<ruby-dev:19583>)))

: ((<File/File.dirname>))...
...<dl>)) [lib] [new]

追加

: 添付ライブラリ [lib] [new]

以下のライブラリが新たに追加されました。
((<iconv>)), ((<tsort>)), ((<StringIO>)), ((<strscan>)),
((<fileutils>)), racc/*

: ((<benchmark>)) [new]
added

: Curses [lib] [compat]

Updated. New met...