Starts tracing object allocations.
Stop tracing object allocations.
Note that if ::trace_object_allocations_start
is called n-times, then tracing will stop after calling ::trace_object_allocations_stop
n-times.
The iterator version of the strongly_connected_components
method. obj.each_strongly_connected_component
is similar to obj.strongly_connected_components.each
, but modification of obj during the iteration may lead to unexpected results.
each_strongly_connected_component
returns nil
.
class G include TSort def initialize(g) @g = g end def tsort_each_child(n, &b) @g[n].each(&b) end def tsort_each_node(&b) @g.each_key(&b) end end graph = G.new({1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}) graph.each_strongly_connected_component {|scc| p scc } #=> [4] # [2] # [3] # [1] graph = G.new({1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}) graph.each_strongly_connected_component {|scc| p scc } #=> [4] # [2, 3] # [1]
The iterator version of the TSort.strongly_connected_components
method.
The graph is represented by each_node and each_child. each_node should have call
method which yields for each node in the graph. each_child should have call
method which takes a node argument and yields for each child node.
g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]} each_node = lambda {|&b| g.each_key(&b) } each_child = lambda {|n, &b| g[n].each(&b) } TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc } #=> [4] # [2] # [3] # [1] g = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]} each_node = lambda {|&b| g.each_key(&b) } each_child = lambda {|n, &b| g[n].each(&b) } TSort.each_strongly_connected_component(each_node, each_child) {|scc| p scc } #=> [4] # [2, 3] # [1]
True if the gems in the system satisfy dependency
.
Returns whether the HTTP
session is to be kept alive.
Add the –version option to the option parser.
Sets the preset dictionary and returns string
. This method is available just only after Zlib::Deflate.new
or Zlib::ZStream#reset
method was called. See zlib.h for details.
Can raise errors of Z_STREAM_ERROR if a parameter is invalid (such as NULL dictionary) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn’t match the expected one (incorrect adler32 value)
Provide the inflate stream with a dictionary that may be required in the future. Multiple dictionaries may be provided. The inflate stream will automatically choose the correct user-provided dictionary based on the stream’s required dictionary.
Sets the preset dictionary and returns string
. This method is available just only after a Zlib::NeedDict
exception was raised. See zlib.h for details.
Compose a string representing the given inner location field.
Terminate the application with exit code status
, running any exit handlers that might have been defined.
Terminates the RubyGems process with the given exit_code
Get the indentation level.