Returns the (row, column) cofactor which is obtained by multiplying the first minor by (-1)**(row + column).
Matrix.diagonal(9, 5, -3, 4).cofactor(1, 1) => -108
Returns true
if this is a diagonal matrix. Raises an error if matrix is not square.
Returns true
if this is an hermitian matrix. Raises an error if matrix is not square.
Returns true
if this is an orthogonal matrix Raises an error if matrix is not square.
Returns true
if this is an antisymmetric matrix. Raises an error if matrix is not square.
Returns true
if this is a unitary matrix Raises an error if matrix is not square.
Returns a matrix with entries rounded to the given precision (see Float#round
)
Returns the conjugate 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]].conjugate => 1-2i -i 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
Overrides Object#inspect
Returns a vector with entries rounded to the given precision (see Float#round
)
Creates a single-row matrix from this vector.
Overrides Object#inspect
Returns an incremented value of default
according to arg
.
Directs to reject specified class argument.
t
Argument class specifier, any object including Class
.
reject(t)
Add option switch and handler. See make_switch
for an explanation of parameters.
Parses environment variable env
or its uppercase with splitting like a shell.
env
defaults to the basename of the program.
Returns a printable version of mtch.
puts /.$/.match("foo").inspect #=> #<MatchData "o"> puts /(.)(.)(.)/.match("foo").inspect #=> #<MatchData "foo" 1:"f" 2:"o" 3:"o"> puts /(.)(.)?(.)/.match("fo").inspect #=> #<MatchData "fo" 1:"f" 2:nil 3:"o"> puts /(?<foo>.)(?<bar>.)(?<baz>.)/.match("hoge").inspect #=> #<MatchData "hog" foo:"h" bar:"o" baz:"g">
Returns true if the set contains the given object.
Note that include?
and member?
do not test member equality using ==
as do other Enumerables.
See also Enumerable#include?