Class: MatrixUtils

Kekule. MatrixUtils

new MatrixUtils()

Utility methods about matrix.
Source:

Methods

(static) add(m1, m2) → {Array}

Add two matrix.
Parameters:
Name Type Description
m1 Array
m2 Array
Source:
Returns:
Type
Array

(static) create(rowCount, colCount, prefilledValue) → {Array}

Create a matrix with row and col and fill it with prefilledValue.
Parameters:
Name Type Description
rowCount Int
colCount Int
prefilledValue Float
Source:
Returns:
Type
Array

(static) createIdentity(rowColCount) → {Array}

Create a identity matrix with row and col.
Parameters:
Name Type Description
rowColCount Int
Source:
Returns:
Type
Array

(static) getColCount(matrix) → {Int}

Get col count of a matrix
Parameters:
Name Type Description
matrix Array
Source:
Returns:
Type
Int

(static) getRowCount(matrix) → {Int}

Get row count of a matrix
Parameters:
Name Type Description
matrix Array
Source:
Returns:
Type
Int

(static) getValue(matrix, row, col) → {Float}

Get value in matrix.
Parameters:
Name Type Description
matrix Array
row Int
col Int
Source:
Returns:
Type
Float

(static) minus(matrix)

Turn all values in matrix to minus ones.
Parameters:
Name Type Description
matrix Array
Source:

(static) multiply(m1, m2) → {Array}

Mutiply two matrix.
Parameters:
Name Type Description
m1 Array
m2 Array
Source:
Returns:
Type
Array

(static) setValue(matrix, row, col, value)

Set value in matrix.
Parameters:
Name Type Description
matrix Array
row Int
col Int
value Float
Source:

(static) substract(m1, m2) → {Array}

Substract two matrix.
Parameters:
Name Type Description
m1 Array
m2 Array
Source:
Returns:
Type
Array

(static) transpose(m) → {Array}

Transpose a matrix.
Parameters:
Name Type Description
m Array
Source:
Returns:
Type
Array