imag

imag() Instance Public methods Alias for: imaginary

imaginary

imaginary() Instance Public methods 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 imag

index

index(value, selector = :all) â [row, column]index(selector = :all){ block } â [row, column]index(selector = :all) â an_enumerator Instance Public methods The index method is specialized to return the index as [row, column] It also accepts an optional selector argument, see each for details. Matrix[ [1,2], [3,4] ].index(&:even?) # => [0, 1] Matrix[ [1,1], [1,1] ].index(1, :strict_lower) # => [1, 0] find_index

inspect

inspect() Instance Public methods Overrides Object#inspect

inv

inv() Instance Public methods Alias for: inverse

inverse

inverse() Instance Public methods Returns the inverse of the matrix. Matrix[[-1, -1], [0, -1]].inverse => -1 1 0 -1 inv

lower_triangular?

lower_triangular?() Instance Public methods Returns true is this is a lower triangular matrix.

lup

lup() Instance Public methods Returns the LUP decomposition of the matrix; see LUPDecomposition. a = Matrix[[1, 2], [3, 4]] l, u, p = a.lup l.lower_triangular? # => true u.upper_triangular? # => true p.permutation? # => true l * u == p * a # => true a.lup.solve([2, 5]) # => Vector[(1/1), (1/2)] lup_decomposition

lup_decomposition

lup_decomposition() Instance Public methods Alias for: lup

map

map() Instance Public methods Alias for: collect