Bill Allombert on Mon, 17 Dec 2012 17:46:58 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: matdet vs. matdetint for large square matrices |
On Mon, Dec 17, 2012 at 11:26:45AM -0500, Max Alekseyev wrote: > Dear pari-users, > > Description of matdetint(x) says that "when x is square, the exact > determinant is obtained". > I noticed that for large binary square matrices (of order several > hundreds), matdetint(x) gives roughly a triple speedup. > > Btw, it turns out that for square matrices, matdetint(x) gives the > value of determinant up to a sign not exact (the description should > have reflected this fact). No it is a bug in matdetint(), please report it. > In general, I'm interested in a fast way of testing whether matdet(x) > == 0 for an integer matrix x. > In my case among > matdet(x) == 0 > matrank(x) < matsize(x)[1] > matdetint(x) == 0 > the best performance is given by the last variant. > Is there anything better? Probably, it depends on the input distribution. For example you could compute the discriminant mod p for a set of small primes. If one the result is not 0, then you know matdet()!=0. Otherwise you can call matdetint. In the development branch, matdet should be much faster for integer matrix. Please test it. Cheers, Bill.