Returns true
if all entries of the matrix are real.
Returns true
if this is a regular (i.e. non-singular) matrix.
Returns true
if this is a square matrix.
Returns the real 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]].real => 1 0 0 1 2 3
Returns an array containing matrices corresponding to the real and imaginary parts of the matrix
m.rect == [m.real, m.imag] # ==> true for all matrices m
Creates a vector from an Array
. The optional second argument specifies whether the array itself or a copy is used internally.
Directs to reject specified class argument.
t
Argument class specifier, any object including Class
.
reject(t)
Release code
Returns version string from program_name
, version and release.
Returns the array of captures; equivalent to mtch.to_a[1..-1]
.
f1,f2,f3,f4 = /(.)(.)(\d+)(\d)/.match("THX1138.").captures f1 #=> "H" f2 #=> "X" f3 #=> "113" f4 #=> "8"
This says “you can break a line here if necessary”, and a width
-column text sep
is inserted if a line is not broken at the point.
If sep
is not specified, “ ” is used.
If width
is not specified, sep.length
is used. You will have to specify this when sep
is a multibyte character, for example.
Looks up the first IP address for name
.
Looks up all IP address for name
.
Looks up the first IP address for name
.
Looks up all IP address for name
.
Creates a temporary file as usual File
object (not Tempfile
). It doesn’t use finalizer and delegation.
If no block is given, this is similar to Tempfile.new
except creating File
instead of Tempfile
. The created file is not removed automatically. You should use File.unlink
to remove it.
If a block is given, then a File
object will be constructed, and the block is invoked with the object as the argument. The File
object will be automatically closed and the temporary file is removed after the block terminates. The call returns the value of the block.
In any case, all arguments (basename
, tmpdir
, mode
, and **options
) will be treated as Tempfile.new
.
Tempfile.create('foo', '/home/temp') do |f| # ... do something with f ... end
Wraps the block in a single, VM-global Mutex.synchronize
, returning the value of the block. A thread executing inside the exclusive section will only block other threads which also use the Thread.exclusive
mechanism.
Returns true
if thr
is running or sleeping.
thr = Thread.new { } thr.join #=> #<Thread:0x401b3fb0 dead> Thread.current.alive? #=> true thr.alive? #=> false