53件ヒット
[1-53件を表示]
(0.469秒)
種類
- インスタンスメソッド (21)
- 文書 (21)
- ライブラリ (11)
ライブラリ
- tsort (21)
モジュール
- TSort (21)
キーワード
-
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) - tsort (11)
検索結果
先頭5件
-
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator (24288.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| . . . } -> () (24288.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 (78.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 (36.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...