Matrix
mixin Matrix
Interface for matrix implementations. A matrix is a rectangular array of numbers.
Compute the inverse of the matrix
Computes A - B and returns a new matrix
Computes A * B and returns a new matrix
Set the element at A[i,j], where i is the row index, and j is column index
The number of rows in the matrix
Compute the cofactor of the matrix
Set every element in the matrix to the given val
The number of columns in the matrix
Computes A + B and returns a new matrix
Get the element at A[i,j], where i is the row index, and j is column index
Get the transpose of the matrix
Computes x * A
Return true if the matrix is square
Compute the determinant of the matrix
abstract Matrix cofactor()
Compute the cofactor of the matrix. The matrix must be square.
abstract Float determinant()
Compute the determinant of the matrix. The matrix must be square.
abstract This fill(Float val)
Set every element in the matrix to the given val.
abstract Float get(Int i, Int j)
Get the element at A[i,j], where i is the row index, and j is column index.
abstract Matrix inverse()
Compute the inverse of the matrix.
abstract Bool isSquare()
Return true if the matrix is square.
@Operator
abstract Matrix minus(Matrix b)
Computes A - B and returns a new matrix.
@Operator
abstract Matrix mult(Matrix b)
Computes A * B and returns a new matrix.
abstract This multScalar(Float x)
Computes x * A.
abstract Int numCols()
The number of columns in the matrix.
abstract Int numRows()
The number of rows in the matrix.
@Operator
abstract Matrix plus(Matrix b)
Computes A + B and returns a new matrix.
abstract This set(Int i, Int j, Float val)
Set the element at A[i,j], where i is the row index, and j is column index.
abstract Matrix transpose()
Get the transpose of the matrix.