is the type of element storable in the matrix
The public constructor of DanMatrix
is the type of element storable in the matrix
Optionalprops: DanMatrixConstructorType<T>the optional input of type DanMatrixConstructorType
Add a column to the matrix
the column to be added
true if the new column was correctly added, otherwise it returns false
Add a row to the matrix
the row to be added
true if the new row was correctly added, otherwise it returns false
Get the number of columns of the matrix
the number of columns of the matrix
Get the number of elements of the matrix
the number of elements of the matrix
Get the matrix value at (x, y)
the Coordinates instance (x,y) for rows and columns
the value at (x, y) or undefined if the coordinates are wrong
Get all the adjacent elements given a specific coordinate
| top-left | top | top-right |
| left | element | right |
| bottom-left | bottom | bottom-right |
the coordinates of the element to get the adjacents from
the list of adjacent elements
Get matrix column at columnIndex
the column index
the requested column as array of values
Get a string representation of the current DanMatrix instance
an optional numeric value for the cell spacing (default is 15)
a string representation of the current DanMatrix instance
Get matrix row at rowIndex
the row index
the requested row as array of values
Insert a column at the specific columnIndex index
the column index
the column to insert as an array of values
true if the new column was correctly inserted, otherwise it returns false
Insert a row at the specific rowIndex index
the row index
the row to insert as an array of values
true if the new row was correctly inserted, otherwise it returns false
Look for a specific value inside the matrix
the value you're looking for
Remove matrix column at index 'columnIndex'
the index of the column to be removed. If it's not an integer number or if it's less than zero, an exception "Error('Wrong input')" is thrown
true if the column removal was successful, otherwise it returns false
Remove matrix row at index 'rowIndex'
the index of the row to be removed. If it's not an integer number or if it's less than zero, an exception "Error('Wrong input')" is thrown
true if the row removal was successful, otherwise it returns false
Replace matrix column at index 'columnIndex'
the index of the column to be replaced. If it's not an integer number or if it's less than zero, an exception "Error('Wrong input')" is thrown
the array of values which must replace the existing column. If it's not an array or if the array is empty, an exception "Error('Wrong input')" is thrown
true if the column replacement was successful, otherwise it returns false
Replace matrix row at index 'rowIndex'
the index of the row to be replaced. If it's not an integer number or if it's less than zero, an exception "Error('Wrong input')" is thrown
the array of values which must replace the existing row. If it's not an array or if the array is empty, an exception "Error('Wrong input')" is thrown
true if the row replacement was successful, otherwise it returns false
Get the number of rows of the matrix
the number of rows of the matrix
Set a value at (x, y)
the Coordinates instance (x,y) for rows and columns
the value to set
the new value set at (x, y) or undefined if the coordinates are wrong
The public method to setup the matrix
Optionalprops: DanMatrixConstructorType<T>the optional input of type DanMatrixConstructorType
DanMatrix is a class to handle two-dimension vectors, or matrices