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:

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

lup() Instance Public methods Returns the LUP decomposition of the matrix; see

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

collect() Instance Public methods Returns a matrix that is the result of iteration

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

**(other) Instance Public methods

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

each(which = :all) Instance Public methods Yields all elements of the matrix

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

minor(*param) Instance Public methods Returns a section of the matrix. The

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

/(other) Instance Public methods

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

imaginary() Instance Public methods Returns the imaginary part of the matrix

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

to_a() Instance Public methods Alias for:

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

rank() Instance Public methods Returns the rank of the matrix. Beware that using

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

hash() Instance Public methods Returns a hash-code for the matrix.

2025-01-10 15:47:30