Karim Belabas on Sat, 08 Sep 2012 10:23:20 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Strange performance of matdet


* Jernej Azarija [2012-09-08 09:52]:
> As a final question - given that sometimes one knows in advance that a
> given matrix consist only of integer/real entries, is it advisable to
> pass the flag=1 or is still preferable to let the heuristic decide for
> itself?

In general, one should let alone the default behaviour and only use
optional flags for specific reasons. That's the idea on our side: the
default behaviour should be "good enough" (or better:-) for everyone.

In this particular case, matdet(M, 1) is used to *force* naive Gaussian
elimination. This is going to take place anyway for real entries,
but not necessarily for integer entries, since the default modular
algorithms (I'm including the classical Chinese remaindering proposed by
Loic for small dimensions) are in principle faster.

Thus, from the efficiency standpoint, flag = 1 is potentially harmful
(anything else than real entries), and useless otherwise. I just timed
it for small matrices with real entries: the time needed to inspect the
coefficients is negligible; not measurable in fact.

As far as I can see, flag = 1 is mostly obsolete now [ it *used* to be
necessary when we had no driver routine ]. I did not remove it 
- for compatibility's sake
- because it can still be useful to check a result, make sure the
  naive algorithm is not competitive ... or to work around a bug as in
  the current situation :-)

Cheers,

    K.B.
-- 
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux1.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux1.fr/  [PARI/GP]
`