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:

row_vector
  • References/Ruby on Rails/Ruby/Classes/Matrix

row_vector(row) Class Public methods Creates a single-row matrix where the values

2025-01-10 15:47:30
to_ary
  • References/Ruby on Rails/Ruby/Classes/Matrix/Matrix::LUPDecomposition

to_ary() Instance Public methods Returns L, U, P

2025-01-10 15:47:30
solve
  • References/Ruby on Rails/Ruby/Classes/Matrix/Matrix::LUPDecomposition

solve(b) Instance Public methods Returns m so that A*m =

2025-01-10 15:47:30
rows
  • References/Ruby on Rails/Ruby/Classes/Matrix

rows(rows, copy = true) Class Public methods Creates a matrix where rows

2025-01-10 15:47:30
inv
  • References/Ruby on Rails/Ruby/Classes/Matrix

inv() Instance Public methods Alias for:

2025-01-10 15:47:30
columns
  • References/Ruby on Rails/Ruby/Classes/Matrix

columns(columns) Class Public methods Creates a matrix using columns

2025-01-10 15:47:30