種類
- インスタンスメソッド (42)
- 文書 (21)
- ライブラリ (11)
ライブラリ
- tsort (42)
モジュール
- TSort (42)
キーワード
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
each
_ strongly _ connected _ component _ from (21) - tsort (11)
検索結果
先頭5件
- TSort
# each _ strongly _ connected _ component -> Enumerator - TSort
# each _ strongly _ connected _ component {|nodes| . . . } -> nil - TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator - TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) {|nodes| . . . } -> () - NEWS for Ruby 2
. 2 . 0
-
TSort
# each _ strongly _ connected _ component -> Enumerator (24318.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 を返します......s 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_... -
TSort
# each _ strongly _ connected _ component {|nodes| . . . } -> nil (24318.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 を返します......s 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_... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator (12294.0) -
node から到達可能な強連結成分についてのイテレータです。
...せん。
each_strongly_connected_component_from は
tsort_each_node を呼びません。
@param node ノードを指定します。
//emlist[例 到達可能なノードを表示する][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(no......de, &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
nodes.each {|node|
non_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| . . . } -> () (12294.0) -
node から到達可能な強連結成分についてのイテレータです。
...せん。
each_strongly_connected_component_from は
tsort_each_node を呼びません。
@param node ノードを指定します。
//emlist[例 到達可能なノードを表示する][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(no......de, &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
nodes.each {|node|
non_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... -
NEWS for Ruby 2
. 2 . 0 (84.0) -
NEWS for Ruby 2.2.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ださい。
== 2.1.0 以降の変更
=== 言語仕様の変更
* nil/true/false
* nil/true/false はフリーズされました 8923
* Hash リテラル
* 後ろにコロンのあるシンボルをキーにしたときそれをクオートできるようになりました 4276
*......://docs.seattlerb.org/rubygems/History_txt.html#label-2.4.2+%2F+2014-10-01
* tsort
* TSort.tsort_each, TSort.each_strongly_connected_component,
TSort.each_strongly_connected_component_from はブロックを省略すると Enumerator を返すようになりました。
* xmlrpc......rb_num2long は SIGNED_VALUE のかわりに long を返します
* rb_num2ulong は VALUE のかわりに unsigned long を返します
* st hash table は速度のために2のべき乗のサイズを使います。9425.
適切はハッシュ関数を使うと探索は10-25%速くなり... -
tsort (60.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,......def rule(outputs, inputs=[], &block)
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}......if inputs_time != nil && inputs_time.to_i == Time.now.to_i
block.call
end
end
}
end
def tsort_each_child(node, &block)
@dep[node].each(&block)
end
include TSort
end
def command(arg)
print arg, "\n"
system arg
end
m = Make.new
m.rule(%w[t1]) { command '... -
NEWS for Ruby 2
. 1 . 0 (42.0) -
NEWS for Ruby 2.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...support refinement inheritance by Module#include
=== 組み込みクラスの互換性 (機能追加とバグ修正を除く)
* Hash
* 非互換: Hash#reject は将来のバージョンでは単なるハッシュオブジェクトを返すようにする予定です。
サブクラ......#allocation_class_path
* 追加: ObjectSpace.#allocation_method_id
* 追加: ObjectSpace.#allocation_generation
* 追加: ObjectSpace.#reachable_objects_from_root
* 追加: ObjectSpace.#dump
* 追加: ObjectSpace.#dump_all
* OpenSSL::BN
* 拡張: OpenSSL::BN.new Fixnum や......。
* tsort
* 追加: TSort#tsort
* 追加: TSort#tsort_each
* 追加: TSort#strongly_connected_components
* 追加: TSort#each_strongly_connected_component
* 追加: TSort#each_strongly_connected_component_from
* webrick
* レスポンスボディは readpartial や re...