diff --git a/lib/matrix.gi b/lib/matrix.gi index 121fea57f1..3d96fba054 100644 --- a/lib/matrix.gi +++ b/lib/matrix.gi @@ -1489,7 +1489,7 @@ InstallMethod( DeterminantMatDestructive, # make its row the current row if i <> j then - row := mat[j]; mat[j] := mat[i]; mat[i] := row; + SwapMatrixRows(mat, j, i); sgn := -sgn; else row := mat[j]; @@ -1566,9 +1566,7 @@ function( mat ) # ... make its row the current row, ... if k <> j then - row := mat[j]; - mat[j] := mat[k]; - mat[k] := row; + SwapMatrixRows(mat, j, k); sgn := -sgn; else row := mat[j]; @@ -1789,30 +1787,20 @@ local R,M,transform,divide,swaprow, swapcol, addcol, addrow, multcol, multrow, l swaprow:=function(a,b) local r; - r:=M[a]; - M[a]:=M[b]; - M[b]:=r; + SwapMatrixRows(M, a, b); if transform then - r:=left[a]; - left[a]:=left[b]; - left[b]:=r; + SwapMatrixRows(left, a, b); if basmat<>fail then - r:=basmat[a]; - basmat[a]:=basmat[b]; - basmat[b]:=r; + SwapMatrixRows(basmat, a, b); fi; fi; end; swapcol:=function(a,b) local c; - c:=M{[1..l]}[a]; - M{[1..l]}[a]:=M{[1..l]}[b]; - M{[1..l]}[b]:=c; + SwapMatrixColumns(M, a, b); if transform then - c:=right{[1..n]}[a]; - right{[1..n]}[a]:=right{[1..n]}[b]; - right{[1..n]}[b]:=c; + SwapMatrixColumns(right, a, b); fi; end; diff --git a/lib/zlattice.gi b/lib/zlattice.gi index d4204340b7..95e203cecd 100644 --- a/lib/zlattice.gi +++ b/lib/zlattice.gi @@ -195,9 +195,7 @@ InstallGlobalFunction( LinearIndependentColumns, function( mat ) fi; # Swap rows `j' and `i'. - row:= mat[j]; - mat[j]:= mat[i]; - mat[i]:= row; + SwapMatrixRows(mat, i, j); # Normalize column `k'. val:= row[k];