34.9 DeterminantMat

DeterminantMat( mat )

DeterminantMat returns the determinant of the square matrix mat. The determinant is defined by
sum_{p in Symm(n)}{sign(p)prod_{i=1}^{n}{mat[i][i^p]}}.

    gap> DeterminantMat( [ [ 1, 2 ], [ 3, 4 ] ] );
    -2
    gap> DeterminantMat( [ [ 0*Z(3), Z(3)^0 ], [ Z(3)^0, Z(3) ] ] );
    Z(3) 

Note that DeterminantMat does not use the above definition to compute the result. Instead it performs a Gaussian elimination. For large rational matrices this may take very long, because the entries may become very large, even if the final result is a small integer.

Previous Up Top Next
Index

GAP 3.4.4
April 1997