frozen_string_literal: false


frozen_string_literal: false


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:

  • Matrix[*rows]

  • Matrix.[](*rows)

  • Matrix.rows(rows, copy = true)

  • Matrix.columns(columns)

  • Matrix.build(row_count, column_count, &block)

  • Matrix.diagonal(*values)

  • Matrix.scalar(n, value)

  • Matrix.identity(n)

  • Matrix.unit(n)

  • Matrix.I(n)

  • Matrix.zero(n)

  • Matrix.row_vector(row)

  • Matrix.column_vector(column)

  • Matrix.empty(row_count, column_count)

  • Matrix.hstack(*matrices)

  • Matrix.vstack(*matrices)

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

Properties of a matrix:

Matrix arithmetic:

Matrix functions:

Matrix decompositions:

Complex arithmetic:

Conversion to other data types:

String representations:

Constants

SELECTORS = {all: true, diagonal: true, off_diagonal: true, lower: true, strict_lower: true, strict_upper: true, upper: true}.freeze

Attributes

[R] column_size

Returns the number of columns.

[R] column_count

Returns the number of columns.

[R] rows

instance creations

Show files where this class is defined (3 files)
Register or log in to add new notes.