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:

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

build(row_count, column_count = row_count) Class Public methods Creates a matrix

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

hermitian?() Instance Public methods Returns true is this is an

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

inverse() Instance Public methods Returns the inverse of the matrix.

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

eigenvalues() Instance Public methods Returns the eigenvalues in an array

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

new(a) Class Public methods Constructs the eigenvalue decomposition for a square

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

det() Instance Public methods Returns the determinant of A, calculated

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

coerce(other) Instance Public methods The coerce method provides support for

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

clone() Instance Public methods Returns a clone of the matrix, so that the contents

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

element(i, j) Instance Public methods Alias for:

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

t() Instance Public methods Alias for:

2025-01-10 15:47:30