Given an element a belonging to the matrix algebra R over the ring S, return the i-th row of a as an element of the natural S-module associated with R.
Given an element a belonging to the matrix algebra R over the ring S, an integer i in the range [1, n] and an element u of the natural S-module associated with R, replace the i-th row of a by the vector u.
Given an element a belonging to the matrix algebra R over the ring S, return the (i, j)-th entry of a as an element of S.
Given an element a belonging to the matrix algebra R over the ring S, integers i and j in the range [1, n], and an element t of S, replace the (i, j)-th entry of a by t.
Given an element a of the matrix algebra R over S, where a = (aij), 1 ≤i, j ≤n, return a as the sequence of elements of S: [a11, ..., a1n, a21, ..., a2n, ..., an1, ..., ann].
Given a matrix a belonging to a subalgebra of Mn(S) and integers i, j, p and q satisfying the conditions, 1 ≤i + p ≤m, 1 ≤j + q ≤n, create the matrix b consisting of the p x q submatrix of a whose first entry is the (i, j)-th entry of a. If p ≠q, the matrix b is created as an element of Hom(P, Q), where Rank(P) = p, Rank(Q) = q. Otherwise it is created as an element of Mp(S).
(Procedure.) Given that the matrix a belongs to a subalgebra of Mn(S) and the p x q matrix b is also over S, the integers i, j, p and q must satisfy the conditions, 1 ≤i + p ≤m, 1 ≤j + q ≤n. This procedure modifies a so that the p x q block beginning at the (i, j)-th entry of a is replaced by b.
Given matrices X with r rows and c columns, and Y with r rows and d columns, both over the same coefficient ring R, return the matrix over R with r rows and (c + d) columns obtained by joining X and Y horizontally (placing Y to the right of X).
Given a sequence Q of matrices, each having the same number of rows and being over the same coefficient ring R, return the matrix over R obtained by joining the elements of Q horizontally in order.
Given matrices X with r rows and c columns and Y with s rows and c columns, both over the same coefficient ring R, return the matrix with (r + s) rows and c columns over R obtained by joining X and Y vertically (placing Y underneath X).
Given a sequence Q of matrices, each having the same number of columns and being over the same coefficient ring R, return the matrix over R obtained by joining the elements of Q vertically in order.
Given matrices X with a rows and b columns and Y with c rows and d columns, both over the same coefficient ring R, return the matrix with (a + c) rows and (b + d) columns over R obtained by joining X and Y diagonally (placing Y diagonally to the right of and underneath X, with zero blocks above and below the diagonal).
Given a sequence Q of matrices, each being over the same coefficient ring R, return the matrix over R obtained by joining the elements of Q diagonally in order.
For the following operations, a is an element of a subring of the matrix algebra Mn(S), u is a non-zero element of S, and i and j are integers in the range [1, n]. Each of the operations described here acts on the matrix in place, and is therefore implemented as a procedure.
Mutate the matrix a by interchanging rows i and j.
Mutate the matrix a by multiplying row j by the scalar u.
Mutate the matrix a by adding u times row i to row j.
Mutate the matrix a by interchanging columns i and j.
Mutate the matrix a by multiplying column i by the scalar u.
Mutate the matrix a by adding u times column i to column j.