Methods
rows ( -- number ) returns the number of rows (vertical size) of the matrix
columns ( -- number ) returns the number of columns (horizontal size) of the matrix
dimension ( -- ( numberOfRows numberOfColumns ) ) returns matrix size as a pair (rows columns)
size ( -- number ) returns the number of rows or columns in a square matrix
row ( index -- row ) returns a row by index as a vector
column ( index -- column ) returns a column by index as a vector
swapRows ( index0 index1 -- ) swaps two rows
swapColumns ( index0 index1 -- ) swaps two columns
rowRange ( index -- range ) returns range points for all elements of one row
columnRange ( index -- range ) returns range points for all elements of one column
makeRange ( -- range ) returns range points for all elements of the matrix
isSquare ( -- condition ) checks if the matrix is square (the number of rows equals to the number of columns)
Free functions
makeMatrix ( enumerableOfEnumerables -- matrix ) creates a matrix with elements from the enumerables
neg ( matrix0 -- matrix1 ) negates all elements of a matrix
@ ( rowIndex columnIndex matrix -- value ) returns an element of a matrix by row index and column index
! ( value rowIndex columnIndex matrix -- ) sets an element of a matrix by row index and column index
+ ( matrix0 matrix1 -- matrix2 ) adds matrixes
- ( matrix0 matrix1 -- matrix2 ) subtracts matrixes
* ( matrix0 matrix1 -- matrix2 ) multiplies matrixes
* ( vector0 matrix -- vector1 ) multiplies a horizontal vector by a matrix
* ( matrix0 value -- matrix1 ) multiplies a matrix by a number
/ ( matrix0 value -- matrix1 ) divides a matrix by a number
= ( matrix0 matrix1 -- condition ) compares matrixes element-wise
inv ( matrix -- adjugateMatrix determinant eigenvector invertibleCondition ) inverts a matrix or returns its eigenvector
homSolve ( matrix -- eigenvector existenceCondition ) returns an eigenvector
det ( matrix -- determinant ) returns determinant of a matrix
isSolvable ( matrix vector -- condition ) checks if a system of linear equations is solvable
solve ( matrix vector -- solutionVector solutionDivisor eigenvector solvableCondition ) solves a system of linear equations or returns an eigenvector that is not perpendicular to the input vector
rank ( matrix -- rank ) returns rank of a matrix
signOfDeterminant ( matrix -- sign ) returns the sign of determinant of a matrix
Tags
MATRIX