|\^/| Maple 2022 (X86 64 LINUX) ._|\| |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2022 \ MAPLE / All rights reserved. Maple is a trademark of <____ ____> Waterloo Maple Inc. | Type ? for help. > FFGE := proc(A::Matrix) # Bareiss/Edmonds over the integers > local n,m,mu,det,i,j,k,N; > n,m := op(1,A); > if n<>m then error "Matrix is not square\n" fi; > mu := 1; > det := 1; > for k to n-1 do > i := k; > while i<=n and A[i,k]=0 do i++; od; > if i>n then return 0; fi; > if i>k then # interchange rows i and k > det := -det; > for j from k to n do > A[i,j],A[k,j] := A[k,j],A[i,k]; > od; > fi; > for i from k+1 to n do > for j from k+1 to n do > N := A[k,k]*A[i,j]-A[i,k]*A[k,j]; > A[i,j] := iquo(N,mu); > od; > A[i,k] := 0; > od; > mu := A[k,k]; > od; > det; > end: > with(LinearAlgebra): > c := rand(10^4): > for n from 3 to 4 do > A := Matrix(n,n,c); > Determinant(A); > FFGE(A); > A; > od; [7926 8057 5] [ ] A := [3002 2347 9765] [ ] [3354 5860 6906] -228187346372 1 [7926 8057 5] [ ] [ 0 -5584792 77382380] [ ] [ 0 0 -228187346372] [5281 5393 1203 311] [ ] [9386 9810 5144 7995] A := [ ] [3121 9390 2055 6505] [ ] [5293 2987 2440 8012] -569192119134689 1 [5281 5393 1203 311] [ ] [ 0 1187912 15874106 39302549] [ ] [ 0 0 -96867450578 -236277191425] [ ] [ 0 0 0 -569192119134689] > quit memory used=3.0MB, alloc=8.3MB, time=0.04