PiMath API
    Preparing search index...

    Class AbstractMatrix<T>Abstract

    Common behaviour of Matrix (fraction entries) and PolyMatrix (polynom entries): a rectangular array of values with arithmetic, determinant, inverse, row reduction and LaTeX output. Indices are zero-based. Operations modify the matrix and return it, unless their description says they return a new matrix; clone() keeps the original.

    Type Parameters

    Hierarchy (View Summary)

    Implements

    Index
    • get asVmatrix(): this

      Delimiter option: single vertical bars, as for a determinant. Chainable, persistent.

      Returns this

    • get dimension(): { cols: number; rows: number }

      Number of rows and columns, as {rows, cols}.

      Returns { cols: number; rows: number }

    • get display(): string

      Text output such as ((1,2),(3,4)). The outer brackets follow the delimiter option, and a partition adds a |. This is the format read by parse.

      Returns string

    • get tex(): string

      LaTeX output: a pmatrix environment by default, one row per line. With a partition (withPartition), an array with a vertical bar. An empty matrix gives an empty string.

      Returns string

    • Returns element at position (i, j), or null if the index is out of bounds.

      Parameters

      • i: number
      • j: number

      Returns T | null

    • A full duplicate of the values and of the partition. The delimiter option (asBmatrix...) is not kept.

      Returns this

    • The cofactor of the entry at row, column: the determinant of the matrix without that row and column, times (-1)^(row+column).

      Parameters

      • row: number
      • column: number

      Returns T

    • Call callback(value, row, column) for each entry. The entries are the real objects: they can be modified.

      Parameters

      • callback: (aij: T, row: number, column: number) => void

      Returns void

    • Inverts this matrix in place.

      Returns this

      if the matrix is not invertible (singular or non-square)

    • Returns true if the augmented matrix [A|b] has a consistent system of equations. A row [0…0 | c≠0] after row reduction signals inconsistency. Always returns true when no partition has been set.

      Returns boolean

    • Build an array of rows from callback(value, row, column).

      Type Parameters

      • U

      Parameters

      • callback: (aij: T, row: number, column: number) => U

      Returns U[][]

    • Replace the content with a display string ("((1,2),(3,4))"), an array of rows, or vectors (one per column).

      Parameters

      Returns this

      if the rows (or the vectors) do not all have the same length.

    • Raise to a non-negative integer power. The power 0 gives the identity.

      Parameters

      • value: number

      Returns this

      if value is negative or not an integer.

      if the matrix is not square and the power is 2 or more.

    • Returns the rank of this matrix — the number of non-zero rows after reduction to row echelon form.

      Returns number

    • Returns a new matrix in reduced row echelon form (Gauss-Jordan). Each pivot column has exactly one non-zero entry (value 1). Does not modify the receiver.

      Returns this

    • Returns a new matrix in row echelon form (forward Gauss elimination). The matrix is upper-triangular with each pivot normalised to 1. Does not modify the receiver.

      Returns this

    • Sets the column index that separates the coefficient columns from the augmented column(s) in display and tex output. A | separator is inserted before column col. The partition persists until overwritten.

      Parameters

      • col: number

      Returns this

      if col is not strictly between 0 and the column count