Results for: "partition"

Returns true if this is a lower triangular matrix.

Returns true if this is an upper triangular matrix.

Hadamard product

Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]])
  => 1  4
     9  8

Private. Use Matrix#determinant

Returns the determinant of the matrix, using Bareiss’ multistep integer-preserving gaussian elimination. It has the same computational cost order O(n^3) as standard Gaussian elimination. Intermediate results are fraction free and of lower complexity. A matrix of Integers will have thus intermediate results that are also Integers, with smaller bignums (if any), while a matrix of Float will usually have intermediate results with better precision.

No documentation available

Returns an angle with another vector. Result is within the [0…Math::PI].

Vector[1,0].angle_with(Vector[0,1])
# => Math::PI / 2

Creates an OptionParser::Switch from the parameters. The parsed argument value is passed to the given block, where it can be processed.

See at the beginning of OptionParser for some full examples.

opts can include the following elements:

Argument style:

One of the following:

:NONE, :REQUIRED, :OPTIONAL
Argument pattern:

Acceptable option argument format, must be pre-defined with OptionParser.accept or OptionParser#accept, or Regexp. This can appear once or assigned as String if not present, otherwise causes an ArgumentError. Examples:

Float, Time, Array
Possible argument values:

Hash or Array.

[:text, :binary, :auto]
%w[iso-2022-jp shift_jis euc-jp utf8 binary]
{ "jis" => "iso-2022-jp", "sjis" => "shift_jis" }
Long style switch:

Specifies a long style switch which takes a mandatory, optional or no argument. It’s a string of the following form:

"--switch=MANDATORY" or "--switch MANDATORY"
"--switch[=OPTIONAL]"
"--switch"
Short style switch:

Specifies short style switch which takes a mandatory, optional or no argument. It’s a string of the following form:

"-xMANDATORY"
"-x[OPTIONAL]"
"-x"

There is also a special form which matches character range (not full set of regular expression):

"-[a-z]MANDATORY"
"-[a-z][OPTIONAL]"
"-[a-z]"
Argument style and description:

Instead of specifying mandatory or optional arguments directly in the switch parameter, this separate parameter can be used.

"=MANDATORY"
"=[OPTIONAL]"
Description:

Description string for the option.

"Run verbosely"
Handler:

Handler for the parsed argument value. Either give a block or pass a Proc or Method as an argument.

Add option switch like with on, but at head of summary.

Add option switch like with on, but at tail of summary.

No documentation available
No documentation available
No documentation available

Sets the system path (the Shell instance’s PATH environment variable).

path should be an array of directory name strings.

Waits until all specified threads have terminated. If a block is provided, it is executed for each thread as they terminate.

Specifies the threads that this object will wait for, but does not actually wait.

Waits until any of the specified threads has terminated, and returns the one that does.

If there is no thread to wait, raises ErrNoWaitingThread. If nonblock is true, and there is no terminated thread, raises ErrNoFinishedThread.

Waits until all of the specified threads are terminated. If a block is supplied for the method, it is executed for each thread termination.

Raises exceptions in the same manner as next_wait.

Waits until all specified threads have terminated. If a block is provided, it is executed for each thread as they terminate.

Specifies the threads that this object will wait for, but does not actually wait.

Waits until any of the specified threads has terminated, and returns the one that does.

If there is no thread to wait, raises ErrNoWaitingThread. If nonblock is true, and there is no terminated thread, raises ErrNoFinishedThread.

Waits until all of the specified threads are terminated. If a block is supplied for the method, it is executed for each thread termination.

Raises exceptions in the same manner as next_wait.

Returns an array of the names of the thread-local variables (as Symbols).

thr = Thread.new do
  Thread.current.thread_variable_set(:cat, 'meow')
  Thread.current.thread_variable_set("dog", 'woof')
end
thr.join               #=> #<Thread:0x401b3f10 dead>
thr.thread_variables   #=> [:dog, :cat]

Note that these are not fiber local variables. Please see Thread#[] and Thread#thread_variable_get for more details.

Returns true if the given string (or symbol) exists as a thread-local variable.

me = Thread.current
me.thread_variable_set(:oliver, "a")
me.thread_variable?(:oliver)    #=> true
me.thread_variable?(:stanley)   #=> false

Note that these are not fiber local variables. Please see Thread#[] and Thread#thread_variable_get for more details.

Returns the exit value associated with this LocalJumpError.

Returns an array of the names of global variables.

global_variables.grep /std/   #=> [:$stdin, :$stdout, :$stderr]
Search took: 7ms  ·  Total Results: 2971