ElementaryDivisorsMat( mat )
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 (see
DiagonalizeMat).
gap> m := [ [ 0, -1, 1 ], [ -2, 0, -2 ], [ 2, -2, 4 ] ];; gap> ElementaryDivisorsMat( m ); [ 1, 2, 0 ]
GAP 3.4.4