For the following operations, A is an element of the module Hom_(R)(M, N),
where M and N are free R-modules, each given with respect to a basis.
Further, t is a non-zero element of R, and i and j are integers
satisfying either the condition 1 <= i, j <= dim(M) (row operations) or
1 <= i, j <= dim(N) (column operations).
AddColumn(~X, u, i, j) : ModMatRngElt, RngElt, RngIntElt, RngIntElt ->
Add u times column i to column j in the matrix X. The element u must be an element of the coefficient ring of X; the integers i and j must lie in the range [1, m], where m is the number of columns of X.
Multiply column i of the matrix X by the unit u. The element u must be an element of the coefficient ring of X; the integer i must lie in the range [1, n], where n is the number of columns of X.
Interchange columns i and j of the matrix X.
Add u times row i to row j in the matrix X.
Multiply row j of the matrix X by the unit u.
Interchange rows i and j of the matrix X.
> Z := Integers(); > Z5 := RSpace(Z, 5); > Z6 := RSpace(Z, 6); > M := Hom(Z5, Z6); > A := M ! [ 3, 1, 0, -4, 2, -12, > 2, -4, -5, 5, 23, 6, > 8, 0, 0, 1, 5, 12, > -2, -6, 3, 8, 9, 17, > 11, 12, -6, 4, 2, 27 ]; > A; [ 3 1 0 -4 2 -12] [ 2 -4 -5 5 23 6] [ 8 0 0 1 5 12] [ -2 -6 3 8 9 17] [ 11 12 -6 4 2 27] > > SwapColumns(~A, 1, 2); > A; [ 1 3 0 -4 2 -12] [ -4 2 -5 5 23 6] [ 0 8 0 1 5 12] [ -6 -2 3 8 9 17] [ 12 11 -6 4 2 27] > AddRow(~A, 4, 1, 2); > AddRow(~A, 6, 1, 4); > AddRow(~A, -12, 1, 5); > A; [ 1 3 0 -4 2 -12] [ 0 14 -5 -11 31 -42] [ 0 8 0 1 5 12] [ 0 16 3 -16 21 -55] [ 0 -25 -6 52 -22 171]