Type:
Class
Constants:
SELECTORS : {all: true, diagonal: true, off_diagonal: true, lower: true, strict_lower: true, strict_upper: true, upper: true}.freeze

The Matrix class represents a mathematical matrix. It provides methods for creating matrices, operating on them arithmetically and algebraically, and determining their mathematical properties (trace, rank, inverse, determinant).

Method Catalogue

To create a matrix:

To access Matrix elements/columns/rows/submatrices/properties:

Properties of a matrix:

Matrix arithmetic:

Matrix functions:

Matrix decompositions:

Complex arithmetic:

  • conj

  • conjugate

  • imag

  • imaginary

  • real

  • rect

  • rectangular

Conversion to other data types:

String representations:

round

round(ndigits=0) Instance Public methods Returns a matrix with entries rounded

2015-04-18 09:49:29
index

index(value, selector = :all) â [row, column]index(selector = :all){ block } â [row, column]index(selector = :all) â an_enumerator

2015-04-18 08:20:08
new

new(rows, column_count = rows[0].size) Class Public methods

2015-04-18 05:34:29
lup_decomposition

lup_decomposition() Instance Public methods Alias for:

2015-04-18 08:55:02
trace

trace() Instance Public methods Returns the trace (sum of diagonal elements)

2015-04-18 10:41:58
lower_triangular?

lower_triangular?() Instance Public methods Returns true is this

2015-04-18 08:41:13
[] 2

[](i, j) Instance Public methods Returns element (i,j)

2015-04-18 06:17:33
symmetric?

symmetric?() Instance Public methods Returns true is this is a

2015-04-18 10:15:46
identity

identity(n) Class Public methods Creates an n by n

2015-04-18 05:27:49
empty?

empty?() Instance Public methods Returns true if this is an empty

2015-04-18 07:43:10