Returns a section of the matrix. The parameters are either:
start_row, nrows, start_col, ncols; OR
row_range, col_range
Matrix.diagonal(9, 5, -3).minor(0..1, 0..2) => 9 0 0 0 5 0
Like Array#[]
, negative indices count backward from the end of the row or column (-1 is the last element). Returns nil if the starting row or column is greater than row_count
or column_count
respectively.
Returns the determinant of the matrix.
Beware that using Float
values can yield erroneous results because of their lack of precision. Consider using exact types like Rational
or BigDecimal
instead.
Matrix[[7,6], [3,9]].determinant => 45
deprecated; use Matrix#determinant
Returns the imaginary part of the matrix.
Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]] => 1+2i i 0 1 2 3 Matrix[[Complex(1,2), Complex(0,1), 0], [1, 2, 3]].imaginary => 2i i 0 0 0 0
Terminates option parsing. Optional parameter arg
is a string pushed back to be the first non-option argument.
Returns the main thread.
Terminates thr
and schedules another thread to be run.
If this thread is already marked to be killed, exit
returns the Thread
.
If this is the main thread, or the last thread, exits the process.
Returns the binding associated with prc. Note that Kernel#eval
accepts either a Proc
or a Binding
object as its second parameter.
def fred(param) proc {} end b = fred(99) eval("param", b.binding) #=> 99
Returns the maximum size of the queue.
Sets the maximum size of the queue to the given number
.
Return the generated binding object from event
Returns a Binding
object, describing the variable and method bindings at the point of call. This object can be used when calling eval
to execute the evaluated command in this environment. See also the description of class Binding
.
def get_binding(param) binding end b = get_binding("hello") eval("param", b) #=> "hello"
Returns the object in enum with the minimum value. The first form assumes all objects implement Comparable
; the second uses the block to return a <=> b.
a = %w(albatross dog horse) a.min #=> "albatross" a.min { |a, b| a.length <=> b.length } #=> "dog"
If the n
argument is given, minimum n
elements are returned as a sorted array.
a = %w[albatross dog horse] a.min(2) #=> ["albatross", "dog"] a.min(2) {|a, b| a.length <=> b.length } #=> ["dog", "horse"] [5, 1, 3, 4, 2].min(3) #=> [1, 2, 3]
Returns the object in enum with the maximum value. The first form assumes all objects implement Comparable
; the second uses the block to return a <=> b.
a = %w(albatross dog horse) a.max #=> "horse" a.max { |a, b| a.length <=> b.length } #=> "albatross"
If the n
argument is given, maximum n
elements are returned as an array, sorted in descending order.
a = %w[albatross dog horse] a.max(2) #=> ["horse", "dog"] a.max(2) {|a, b| a.length <=> b.length } #=> ["albatross", "horse"] [5, 1, 3, 4, 2].max(3) #=> [5, 4, 3]
Returns the maximum number of gids allowed in the supplemental group access list.
Process.maxgroups #=> 32
Sets the maximum number of gids allowed in the supplemental group access list.
Returns true
iff the scan pointer is at the beginning of the line.
s = StringScanner.new("test\ntest\n") s.bol? # => true s.scan(/te/) s.bol? # => false s.scan(/st\n/) s.bol? # => true s.terminate s.bol? # => true
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
Is this handler a streaming handler?
Sends a EXAMINE command to select a mailbox
so that messages in the mailbox
can be accessed. Behaves the same as select()
, except that the selected mailbox
is identified as read-only.
A Net::IMAP::NoResponseError
is raised if the mailbox does not exist or is for some reason non-examinable.