ElementaryDivisorsMat( [ring, ]mat ) O
ElementaryDivisors returns a list of the elementary divisors, i.e., the
unique d with d[i] divides d[i+1] and mat is equivalent
to a diagonal matrix with the elements d[i] on the diagonal.
The operations are performed over the ring ring, which must contain
all matrix entries. For compatibility reasons it can be omitted and
defaults to Integers.
gap> mat:=[[1,2,3],[4,5,6],[7,8,9]];; gap> ElementaryDivisorsMat(mat); [ 1, 3, 0 ]
DiagonalizeMat( ring, mat ) O
brings the mutable matrix mat, considered as a matrix over ring, into diagonal form by elementary row and column operations.
gap> m:=[[1,2],[2,1]];; gap> DiagonalizeMat(Integers,m);m; [ [ 1, 0 ], [ 0, 3 ] ]
See also chapter Integral Matrices and Lattices
[Top] [Previous] [Up] [Next] [Index]
GAP 4 manual