[Next] [Prev] [Right] [Left] [Up] [Index] [Root]
Row and Column Operations

Row and Column Operations

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.
MultiplyColumn(~X, u, i) : ModMatRngElt, RngElt, RngIntElt ->
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.
SwapColumns(~X, i, j) : ModMatRngElt, RngIntElt, RngIntElt ->
Interchange columns i and j of the matrix X.
AddRow(~X, u, i, j) : ModMatRngElt, RngElt, RngIntElt, RngIntElt ->
Add u times row i to row j in the matrix X.
MultiplyRow(~X, u, j) : ModMatRngElt, RngElt, RngIntElt ->
Multiply row j of the matrix X by the unit u.
SwapRows(~X, i, j) : ModMatRngElt, RngIntElt, RngIntElt ->
Interchange rows i and j of the matrix X.

Example HMod_RowOps (H43E9)

We illustrate the use of the row and column operations by applying them to a 5 x 6 matrix over the ring of integers Z.

> 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]

[Next] [Prev] [Right] [Left] [Up] [Index] [Root]