Slow calculation of a determinant?



Maxima uses minor expansion to calculate determinants. This is the best
algorithm for calculating (small) symbolic determinants. But this
algorithm is not the best choice for large matrices with integer entries.
I use this code  for larger matrices:

  http://wxmaxima.sourceforge.net/files/idet.lisp

HTH,
Andrej


> I'm just experimenting with Maxima, and comparing it to two systems I
> already have: MuPAD and Scilab. Just for fun, I decided to get each system
> to evaluate the determinant of a 16x16 matrix with entries randomly chosen
> from the integers 0..9. I timed each one:
>
> MuPAD:
>
>>> m:=matrix(16,16,(i,j)->random() mod 10)
>>> time(linalg::det(m))
>
> 95
>
> (Output is in milliseconds).
>
> Scilab:
>
> -->m=floor(rand(16,16)*10)
> -->tic,det(m),toc
> ans
> 6.137E+13
> ans
> 0.04
>
> (Output in seconds.)
>
> Maxima:
>
> (%i1) showtime:true;
> (%i2) f[i,j]:=random(10)$
> (%i3) m:genmatrix(f,16,16);
> (%i4) determinant(m);
> Evaluation took 817.71 seconds (866.82 elapsed) using 94.295 MB.
> (%o4) 470231216693085
>
> That's nearly 14 minutes! What's going on here? Surely such a
> straightforward calculation as this should be nearly instantaneous? And
> look
> at the memory usage!
>
> -Alasdair
>