[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 K^((m x n)). Further, t is a non-zero element of K, and i and j are integers satisfying either the condition 1 <= i, j <= m (row operations) or 1 <= i, j <= n (column operations).

AddColumn(~a, u, i, j) : ModMatElt, RngElt, RngIntElt, RngIntElt ->
Add u times column i to column j in the matrix a.
MultiplyColumn(~a, u, i) : ModMatElt, FldElt, RngIntElt ->
Multiply column i of the matrix a by the unit u.
SwapColumns(~a, i, j) : ModMatElt, RngIntElt, RngIntElt ->
Interchange columns i and j of the matrix a.
AddRow(~a, u, i, j) : ModMatElt, RngElt, RngIntElt, RngIntElt ->
Add u times row i to row j in the matrix a.
MultiplyRow(~a, u, j) : ModMatElt, RngElt, RngIntElt ->
Multiply row i of the matrix a by the unit u.
SwapRows(~a, i, j) : ModMatElt, RngIntElt, RngIntElt ->
Interchange rows i and j of the matrix a.

Example KMod_Rowops (H41E14)

We apply some row and column operations to a 5 x 6 matrix over GF(8).

> K<w> := GF(8);
> K5 := VectorSpace(K, 5);
> K6 := VectorSpace(K, 6);
> M := Hom(K5, K6);
> A := M ! [ w, w, w^3, 1, w^4, w^3,  w^4, w^5, 1, 1, w^6, w^3,  
>               w, w, 0, 0, 1, w^6,      w^4, w^5, w^4, w^4, w, w^2, 
>               w^6, w^4, 0, w^2, w, w^2];
> A;
[  w   w w^3   1 w^4 w^3]
[w^4 w^5   1   1 w^6 w^3]
[  w   w   0   0   1 w^6]
[w^4 w^5 w^4 w^4   w w^2]
[w^6 w^4   0 w^2   w w^2]
> SwapColumns(~A, 1, 2);
> A;
[  w   w w^3   1 w^4 w^3]
[w^4 w^4   1   1 w^6 w^3]
[  w   w   0   0   1 w^6]
[w^4 w^4 w^4 w^4   w w^2]
[w^6 w^6   0 w^2   w w^2]
> MultiplyRow(~A, w^-1, 1);
> AddRow(~A, -w, 1, 3);
> AddRow(~A, -w^4, 1, 4 );
> AddRow(~A, -w^6, 1, 5);
> A;
[  1   1 w^2 w^6 w^3 w^2]
[  0   0 w^2   w w^2 w^4]
[  0   0 w^3   1 w^5 w^4]
[  0   0 w^3 w^6 w^3   1]
[  0   0   w w^3 w^4 w^4]

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