A simple Matrix class in JavaScript ðĪš
A module to construct specific Matrices
A module to construct specific Matrices
Matrix
âMatrix
âMatrix
âMatrix
âMatrix
âMatrix
âCreates a matrix filled with given value
Kind: Exported function
Returns: Matrix
- Created matrix
Param | Type | Description |
---|---|---|
dimX | Number |
Row size of the matrix |
dimY | Number |
Column size of the matrix |
value | Number |
Value to give all elements of the matrix |
type | String |
Expected C-type of the matrix elements |
Matrix
âCreates a matrix filled with 1
s
Kind: Exported function
Returns: Matrix
- Created matrix
Param | Type | Description |
---|---|---|
dimX | Number |
Row size of the matrix |
dimY | Number |
Column size of the matrix |
type | String |
Expected C-type of the matrix elements |
Matrix
âCreates a matrix filled with 0
s
Kind: Exported function
Returns: Matrix
- Created matrix
Param | Type | Description |
---|---|---|
dimX | Number |
Row size of the matrix |
dimY | Number |
Column size of the matrix |
type | String |
Expected C-type of the matrix elements |
Matrix
âCreates an identity matrix of given size
Kind: Exported function
Returns: Matrix
- Created identity matrix
Param | Type | Description |
---|---|---|
size | Number |
Edge size of the square identity matrix |
type | String |
Expected C-type of the matrix elements |
Matrix
âCreates a vector or a matrix from given JavaScript array
Kind: Exported function
Returns: Matrix
- Created identity matrix
Param | Type | Description |
---|---|---|
array | Array |
JavaScript array to be converted into a matrix or vector |
Kind: global class
any
Float64Array
void
Matrix
Matrix
Number
array
Matrix
Matrix
array
void
boolean
boolean
boolean
boolean
boolean
Creates an instance of Matrix.
Param | Type | Description |
---|---|---|
dimX | Number |
Row size of the matrix |
dimY | Number |
Column size of the matrix |
type | String |
Expected C-type of the matrix elements (Defaults to double ) |
any
Returns the value of given location
Kind: instance method of Matrix
Returns: any
- value of given index
Param | Type | Description |
---|---|---|
x | any |
column index |
y | any |
row index |
Float64Array
Returns values of given row
Kind: instance method of Matrix
Returns: Float64Array
- A TypedArray containing the values of given row
Param | Type | Description |
---|---|---|
x | Number |
Row index |
void
Sets the value of given location
Kind: instance method of Matrix
Param | Type | Description |
---|---|---|
x | any |
column index |
y | any |
row index |
entry | any |
value to set given index |
Matrix
Returns transposed copy of self
Kind: instance method of Matrix
Returns: Matrix
- Transposed self
Matrix
Returns row-major flattened version of self
Kind: instance method of Matrix
Returns: Matrix
- row-major flattened copy of self
Number
Returns dot product of self with given matrix
Kind: instance method of Matrix
Returns: Number
- Dot product with other
Param | Type | Description |
---|---|---|
other | Matrix |
The second matrix |
array
Returns the shape of the array as an array of dimensions
Kind: instance method of Matrix
Returns: array
- Tuple of rowCount and colCount
Matrix
Returns lower triangle of the matrix
Kind: instance method of Matrix
Returns: Matrix
- Lower triangle of self
Matrix
Returns upper triangle of the matrix
Kind: instance method of Matrix
Returns: Matrix
- Lower triangle of self
array
Extract diagonal of self
Kind: instance method of Matrix
Returns: array
- Diagonal array of self
void
Prints the text representation of self to console
Kind: instance method of Matrix
boolean
Returns whether the matrix is a Vector
Kind: instance method of Matrix
Returns: boolean
- True if the matrix is 1D
Param | Type | Description |
---|---|---|
mat | Matrix |
Matrix to be checked |
boolean
Returns whether the matrix is a 3D Vector
Kind: instance method of Matrix
Returns: boolean
- True if the matrix is a 3D Vector
Param | Type | Description |
---|---|---|
mat | Matrix |
Matrix to be checked |
boolean
Returns whether the matrix is 1x1
Kind: instance method of Matrix
Returns: boolean
- True if matrix is 1x1
Param | Type | Description |
---|---|---|
mat | Matrix |
Matrix to be checked |
boolean
Returns whether the matrix is a square matrix
Kind: instance method of Matrix
Returns: boolean
- True if matrix is square
Param | Type | Description |
---|---|---|
mat | Matrix |
Matrix to be checked |
boolean
Returns whether the matrix is an identity matrix
Kind: instance method of Matrix
Returns: boolean
- True if the matrix is an identity matrix
Param | Type | Description |
---|---|---|
mat | Matrix |
Matrix to be checked |