class

Matrix

v1_9_2_180 - Show latest stable - Superclass: Object

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_size, column_size, &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)

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

Properties of a matrix:

Matrix arithmetic:

Matrix functions:

Complex arithmetic:

Conversion to other data types:

String representations:

Included modules

  • Enumerable
  • ExceptionForMatrix
  • Matrix::CoercionHelper

Attributes

[R]column_size
[R]rows

Files

  • lib/matrix.rb

Nested classes and modules