Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • new Matrix(values: MatrixParams, width?: undefined | number, height?: undefined | number): Matrix
  • Create a new Matrix to perform calculations with

    Parameters

    • values: MatrixParams

      The values from which the matrix should be constructed

    • Optional width: undefined | number

      The width of the matrix to be constructed

    • Optional height: undefined | number

      The height of the matrix to be constructed

    Returns Matrix

Properties

height

height: number

Protected values

values: number[]

width

width: number

Methods

*

  • Multiply the matrix by a number or by another matrix

    Parameters

    • a: Matrix | number

      The value or the matrix with which the multiplication should take place

    Returns Matrix

+

-

/

^

dot

getValues

  • getValues(): number[]

toString

  • toString(): string
  • Converts matrix to a String. See example below:

    ┌                                ┐
    │ -1,00 -1,92 -1,80 -0,92  0,25  │
    │  0,05  0,99  0,25 -0,50 -0,19  │
    │  0,98 -1,94 -1,35  0,22 -0,88  │
    │ -0,85 -1,63  0,07 -0,39 -0,24  │
    │  0,45 -0,33 -1,14  0,07 -0,61  │
    └                                ┘

    Returns string

Static Private basicMultiplication

Static Private stringTo2DArray

  • stringTo2DArray(input: string): number[][]
  • todo

    Make the from string also work when there are both newlines and ; present

    Parameters

    • input: string

    Returns number[][]

Static Private toMatrixDataFrom2DArray

  • toMatrixDataFrom2DArray(input: number[][]): { height: number; values: number[]; width: number }
  • Parameters

    • input: number[][]

    Returns { height: number; values: number[]; width: number }

    • height: number
    • values: number[]
    • width: number

Generated using TypeDoc