Use __raise__ if your Delegator
does not have a object to delegate the raise method call.
Returns true
iff the current severity level allows for the printing of WARN
messages.
Returns true
iff the current severity level allows for the printing of ERROR
messages.
Creates an n
by n
diagonal matrix where each diagonal element is value
.
Matrix.scalar(2, 5) => 5 0 0 5
Returns true
if this is a regular (i.e. non-singular) matrix.
Returns true
if this is a singular matrix.
Returns true
if this is a square matrix.
Returns true
if this is a unitary matrix Raises an error if matrix is not square.
Returns the rank 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]].rank => 2
deprecated; use Matrix#rank
Returns the trace (sum of diagonal elements) of the matrix.
Matrix[[7,6], [3,9]].trace => 16
Returns the transpose of the matrix.
Matrix[[1,2], [3,4], [5,6]] => 1 2 3 4 5 6 Matrix[[1,2], [3,4], [5,6]].transpose => 1 3 5 2 4 6
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
Puts option summary into to
and returns to
. Yields each line if a block is given.
to
Output destination, which must have method <<. Defaults to [].
width
Width of left side, defaults to @summary_width.
max
Maximum length allowed for left side, defaults to width
- 1.
indent
Indentation, defaults to @summary_indent.
Parses command line arguments argv
in order when environment variable POSIXLY_CORRECT is set, and in permutation mode otherwise.
Same as parse
, but removes switches destructively. Non-option arguments remain in argv
.
Searches key
in @stack for id
hash and returns or yields the result.
Opens a new transaction for the data store. Code executed inside a block passed to this method may read and write data to and from the data store file.
At the end of the block, changes are committed to the data store automatically. You may exit the transaction early with a call to either PStore#commit
or PStore#abort
. See those methods for details about how changes are handled. Raising an uncaught Exception
in the block is equivalent to calling PStore#abort
.
If read_only is set to true
, you will only be allowed to read from the data store during the transaction and any attempts to change the data will raise a PStore::Error
.
Note that PStore
does not support nested transactions.