gap> mat:=IdentityMat(10,GF(2));; ConvertToMatrixRep(mat);; mat;
<a 10x10 matrix over GF2>
gap> for i in [1..1000000] do SwapMatrixColumns(mat,1,2); od; time;
1020
gap> for i in [1..1000000] do SwapMatrixRows(mat,1,2); od; time;
167
gap> for i in [1..1000000] do tmp:=mat[1];mat[1]:=mat[2];mat[2]:=tmp; od; time;
85
After:
gap> mat:=IdentityMat(10,GF(2));; ConvertToMatrixRep(mat);; mat;
<a 10x10 matrix over GF2>
gap> for i in [1..1000000] do SwapMatrixColumns(mat,1,2); od; time;
135
gap> for i in [1..1000000] do SwapMatrixRows(mat,1,2); od; time;
77
gap> for i in [1..1000000] do tmp:=mat[1];mat[1]:=mat[2];mat[2]:=tmp; od; time;
87
Before
After: