The above function returns the value of the _addFn property.
The value of the property _addFn
is being returned.
The function returns the value of the protected variable _cols.
The number of columns.
The function returns a two-dimensional array of numbers.
The data property, which is a two-dimensional array of numbers.
The function returns the value of the _multiplyFn property.
The _multiplyFn
property is being returned.
The function returns the number of rows.
The number of rows.
The function returns the value of the _subtractFn property.
The _subtractFn
property is being returned.
Protected
_addThe function _addScaledRow
multiplies a row in a matrix by a scalar value and adds it to another
row.
The targetRow parameter represents the index of the row in which the scaled values will be added.
The sourceRow parameter represents the index of the row from which the values will be scaled and added to the targetRow.
The scalar parameter is a number that is used to scale the values in the source row before adding them to the target row.
Protected
_scaleThe function scales a specific row in a matrix by a given scalar value.
The row
parameter represents the index of the row in the matrix that you
want to scale. It is a number that indicates the position of the row within the matrix.
The scalar parameter is a number that is used to multiply each element in a specific row of a matrix.
Protected
_swapThe function _swapRows
swaps the positions of two rows in an array.
The row1
parameter is the index of the first row that you want to swap.
The row2
parameter is the index of the second row that you want to swap
with the first row.
The add
function adds two matrices together, returning a new matrix with the result.
The matrix
parameter is an instance of the Matrix
class.
The add
method returns a new Matrix
object that represents the result of adding the
current matrix with the provided matrix
parameter.
The get
function returns the value at the specified row and column index if it is a valid index.
The row
parameter represents the row index of the element you want to
retrieve from the data array.
The parameter "col" represents the column number of the element you want to retrieve from the data array.
The get
function returns a number if the provided row and column indices are valid.
Otherwise, it returns undefined
.
The function checks if the dimensions of the given matrix match the dimensions of the current matrix.
The parameter matrix
is of type Matrix
.
a boolean value.
The function checks if a given row and column index is valid within a specified range.
The row
parameter represents the row index of a two-dimensional array or
matrix. It is a number that indicates the specific row in the matrix.
The "col" parameter represents the column index in a two-dimensional array or grid. It is used to check if the given column index is valid within the bounds of the grid.
A boolean value is being returned.
The set function updates the value at a specified row and column in a two-dimensional array.
The "row" parameter represents the row index of the element in a two-dimensional array or matrix. It specifies the row where the value will be set.
The "col" parameter represents the column index of the element in a two-dimensional array.
The value parameter represents the number that you want to set at the specified row and column in the data array.
a boolean value. It returns true if the index (row, col) is valid and the value is successfully set in the data array. It returns false if the index is invalid and the value is not set.
The subtract
function performs element-wise subtraction between two matrices and returns a new
matrix with the result.
The matrix
parameter is an instance of the Matrix
class. It
represents the matrix that you want to subtract from the current matrix.
a new Matrix object with the result of the subtraction operation.
The constructor function initializes a matrix object with the provided data and options, or with default values if no options are provided.