Description

a matrix class that uses tensorflow tensors to represent matrices

Export

Matrix

Property

the elements of the matrix

Hierarchy

  • Matrix

Constructors

  • Description

    creates an instance of Matrix.

    Parameters

    • elements: Tensor<Rank> | number[][]
    • Optional options: {
          reduced?: boolean;
      }
      • Optional reduced?: boolean

    Returns Matrix

Properties

elements: Tensor<Rank>
properties: {
    columns: number;
    reduced: boolean;
    rows: number;
}

Type declaration

  • columns: number
  • reduced: boolean
  • rows: number
shape: number[]

Accessors

  • get columns(): number
  • Returns number

  • get inverse(): undefined | Matrix
  • Description

    returns the inverse of the matrix

    Returns

    the inverse of the matrix

    Returns undefined | Matrix

  • get pivots(): number[][]
  • Description

    returns the pivot positions of the matrix

    Returns

    the pivot positions of the matrix

    Returns number[][]

Methods

  • Description

    augments a matrix with a vector or matrix

    Returns

    the augmented matrix

    Parameters

    • augmentedColumns: Vector | Matrix

      the vector or matrix to augment the matrix with

    Returns Matrix

  • Description

    returns the column of the matrix

    Returns

    the column of the matrix

    Parameters

    • column: number

    Returns Vector

  • Description

    returns the inverse of the matrix

    Returns

    the determinant of the matrix

    Returns number

  • Description

    returns the main diagonal of the matrix

    Returns

    the main diagonal of the matrix

    Returns Vector

  • Parameters

    • options: {
          iterations?: number;
          rounded?: boolean;
      } = ...
      • Optional iterations?: number
      • Optional rounded?: boolean

    Returns Promise<any>

  • Description

    returns the eigenvalues of the matrix

    Returns

    the eigenvalues of the matrix

    Parameters

    • options: {
          iterations?: number;
          rounded?: boolean;
          unique?: boolean;
      } = ...
      • Optional iterations?: number
      • Optional rounded?: boolean
      • Optional unique?: boolean

    Returns Promise<Vector>

  • Description

    returns the eigenvectors of the matrix

    Returns

    the eigenvectors of the matrix

    Parameters

    • options: {
          iterations?: number;
          rounded?: boolean;
      } = ...
      • Optional iterations?: number
      • Optional rounded?: boolean

    Returns Promise<any>

  • Description

    returns the matrix

    Returns

    the matrix

    Returns number[][]

  • Description

    returns the rows of the matrix

    Returns

    the rows of the matrix

    Parameters

    • Optional row: number
    • Optional column: number

    Returns number | number[] | number[][]

  • Description

    returns the row reduced echelon form of the matrix

    Returns

    the rref of the matrix

    Returns Matrix

  • Description

    returns the matrix scaled by the scalar passed in as an argument

    Returns

    the matrix scaled by the scalar passed in as an argument

    Parameters

    • scalar: number

    Returns Matrix

  • Description

    returns the difference of two matrices

    Returns

    the difference of two matrices

    Parameters

    Returns Matrix

  • Description

    returns the trace of the matrix

    Returns

    the trace of the matrix

    Returns number

  • Description

    returns the transpose of the matrix

    Returns

    the transpose of the matrix

    Returns Matrix

  • Description

    returns a new random matrix

    Returns

    a new random matrix

    Parameters

    • input: number | Matrix
    • Optional inputColumns: number

    Returns Matrix

  • Description

    returns a new identity matrix

    Returns

    a new identity matrix

    Parameters

    • size: number

    Returns Matrix

  • Description

    returns a new ones matrix

    Returns

    a new ones matrix

    Parameters

    • input: number | Matrix
    • Optional inputColumns: number

    Returns Matrix

  • Description

    returns a new zero matrix

    Returns

    a new zero matrix

    Parameters

    • input: number | Matrix
    • Optional inputColumns: number

    Returns Matrix