Hi -- Another question. You just deleted this [1] below -- does flint really solidly beat it?
[1] -############################################################## -# Some people really really really want to make sure their -# 4x4 determinant is really really really fast. -############################################################## - -cdef int four_dim_det(mpz_t r,mpz_t *x) except -1: - """ - Internal function used in computing determinants of 4x4 matrices. - - TESTS:: - - sage: A = matrix(ZZ,4,[1,0,3,0,4,3,2,1,0,5,0,0,9,1,2,3]) - sage: A.determinant() # indirect doctest - 25 - """ - cdef mpz_t a,b - - sig_on() - mpz_init(a) - mpz_init(b) - - mpz_mul(a,x[3], x[6] ); mpz_submul(a,x[2], x[7] ) - mpz_mul(b,x[9], x[12]); mpz_submul(b,x[8], x[13]) - mpz_mul(r,a,b) - mpz_mul(a,x[1], x[7] ); mpz_submul(a,x[3], x[5] ) - mpz_mul(b,x[10],x[12]); mpz_submul(b,x[8], x[14]) - mpz_addmul(r,a,b) - mpz_mul(a,x[2], x[5] ); mpz_submul(a,x[1], x[6] ) - mpz_mul(b,x[11],x[12]); mpz_submul(b,x[8], x[15]) - mpz_addmul(r,a,b) - mpz_mul(a,x[3], x[4] ); mpz_submul(a,x[0], x[7] ) - mpz_mul(b,x[10],x[13]); mpz_submul(b,x[9], x[14]) - mpz_addmul(r,a,b) - mpz_mul(a,x[0], x[6] ); mpz_submul(a,x[2], x[4] ) - mpz_mul(b,x[11],x[13]); mpz_submul(b,x[9], x[15]) - mpz_addmul(r,a,b) - mpz_mul(a,x[1], x[4] ); mpz_submul(a,x[0], x[5] ) - mpz_mul(b,x[11],x[14]); mpz_submul(b,x[10],x[15]) - mpz_addmul(r,a,b) - - mpz_clear(a) - mpz_clear(b) - sig_off() - return 0 On Tue, Aug 12, 2014 at 10:59 AM, William A Stein <[email protected]> wrote: > On Tue, Aug 12, 2014 at 10:52 AM, Martin Albrecht > <[email protected]> wrote: >> Hi, I like the proposal to move some types over to FLINT. However, you >> removed >> some options, e.g. calling Pari, LinBox or IML for solving certain problems >> (charpoly, kernel, …). I'd prefer these options to be preserved as it is not >> clear to me a priori that FLINT will in all cases be fastest. Also, having >> choices allows to compare results. > > +1. In my experience, having implemented Matrix_integer_dense in the > first place, most systems that we call are full of bugs. It's almost > never the case that any of the claimed functions, e.g., charpoly, > kernel, etc. aren't buggy. It's critical (and disturbing) to run test > code comparing the various systems with various random (and not) > inputs. > Also, there are some systems like linbox that have proof=False > options, which can be faster, but will in fact be very wrong, > especially in corner cases. > > I also noticed your patch removes a bunch of verbose output. Why? > Having the potential for logging when running code is very useful: > > - t = verbose('hermite mod %s'%D, caller_name='matrix_integer_dense') > cdef Matrix_integer_dense res = > self._new_uninitialized_matrix(self._nrows, self._ncols) > self._hnf_modn(res, D) > - verbose('finished hnf mod', t, caller_name='matrix_integer_dense') > > william > >> >> Cheers, >> Martin >> >> On Tuesday 12 Aug 2014 10:12:04 Marc Masdeu wrote: >>> Hi, >>> >>> Recently I noticed that Sage was not using fmpz_mat_t for matrices >>> (probably when FLINT was incorporated in Sage it didn't yet have this). I >>> have opened a ticket (http://trac.sagemath.org/ticket/16803 --thanks >>> pbruin!--) with a patch that reimplements matrix_integer_dense with FLINT, >>> and it would probably be a good idea to do a similar thing for fmpq_mat_t. >>> >>> In any case, I am new to FLINT so I might not be doing the right things, if >>> any expert is willing to review the ticket it would be great! >>> >>> Best, >>> >>> Marc. > > > > -- > William Stein > Professor of Mathematics > University of Washington > http://wstein.org > [email protected] -- William Stein Professor of Mathematics University of Washington http://wstein.org [email protected] -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
