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:

determinant
  • References/Ruby on Rails/Ruby/Classes/Matrix/Matrix::LUPDecomposition

determinant() Instance Public methods Alias for:

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

rank_e() Instance Public methods deprecated; use

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

new(a) Class Public methods

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

column_vector(column) Class Public methods Creates a single-column matrix where

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

diagonal(*values) Class Public methods Creates a matrix where the diagonal elements

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

eigenvector_matrix_inv() Instance Public methods Returns the inverse of the

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

elements_to_r() Instance Public methods

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

real?() Instance Public methods Returns true if all entries of

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

to_a() Instance Public methods Returns an array of arrays that describe the

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

u() Instance Public methods Returns the upper triangular factor U

2025-01-10 15:47:30