The Matrix
class represents a mathematical matrix and provides various methods for matrix operations such as addition, multiplication, transposition, and determinant calculation.
Creates a matrix from a two-dimensional array of doubles. Blank elements are replaced by zeros.
Creates a matrix with the specified number of rows and columns, initializing it with the given elements. Blank elements are replaced by zeros.
Creates a matrix with the specified number of rows and columns, initializing all elements to the given value.
Returns a string representation of the matrix, formatted for readability.
Returns the element of the matrix at the specified row and column. Indices start at 1, as in mathematics.
Sets the element of the matrix at the specified row and column to the given value. Indices start at 1.
Returns a submatrix excluding the specified row and column.
Returns the determinant of the matrix. Throws SquareMatrixExpected
if the matrix is not square.
Returns a copy of the matrix.
Returns the transpose of the matrix (switches rows and columns).
Returns the determinant matrix of this matrix (determinant of submatrix per element, alternating signs). Throws SquareMatrixExpected
if the matrix is not square.
Returns the multiplicative inverse of this matrix. Throws SquareMatrixExpected
if the matrix is not square.
Returns the zero matrix of the specified order.
Returns the identity matrix for a given order.
Returns the sum of two matrices.
Returns the product of two matrices.
Returns the product of a matrix and a scalar.
Returns the product of a scalar and a matrix.
The overview of these methods was generated by AI. I have checked it, and it seems to be accurate. Use at your own risk.