#4000: [with patch, needs work] Implement QQ['x'] via Flint ZZ['x'] + 
denominator
------------------------------+---------------------------------------------
 Reporter:  malb              |       Owner:  somebody       
     Type:  enhancement       |      Status:  new            
 Priority:  major             |   Milestone:  sage-wishlist  
Component:  basic arithmetic  |    Keywords:                 
 Reviewer:                    |      Author:  Martin Albrecht
   Merged:                    |  
------------------------------+---------------------------------------------

Comment(by malb):

 Replying to [comment:8 spancratz]:
 > - Say we set up to polynomial rings R[x] and S[y], one using the generic
 implementation and one using FLINT.  Then sometimes (usually?) coercion
 like "f_flint = S(f_generic)" or "f_generic = R(f_flint)" works, but
 sometimes it ends in a segfault.  For two random polynomials f and d, of
 two successive calls "q, s, t = xgcd(f, d)" the first one succeeded and
 the second one ended in a segfault.  This seems *very* strange to me!

 Try running Sage with {{{sage -gdb}}} and/or {{{sage -valgrind}}}. The
 later requires the optional Valgrind SPKG. The output of valgrind is
 incredibly useful and can be found in {{{~/.sage/valgrind}}}. If you don't
 get anywhere, I can take a look. But learning Valgrind is well worth it :)

 > - We achieve a performance gain except in the cases of addition and
 subtraction.  (See below.)

 We should think about how to make it more efficient, e.g. by only
 multiplying by the multiplier to get the LCM? Magma can do it faster than
 what we can do it seems.

 > - The method xgcd doesn't give the right result yet, I'll look into that
 later.
 >
 > - I have no idea what you mean by "Note that there is still some
 conversion code missing in polynomial_rational_flint.pyx."  Are there any
 examples of this in other files?

 You are right, the overflow I was expecting doesn't happen (I think this
 is handled correctly in the base ring). We should consider making {{{x +
 1}}} (1 either int or Integer) fast though by writing special code similar
 to the Rational code in the {{{__init__}}} function of
 {{{polynomial_rational_flint.pyx}}}. Also, construction from a list
 {{{P([1,2,3,4])}}} should be made faster, cf. the zmod_poly
 implementation.

 > - I'll write up the doctests later.  Regarding your comments on using
 the "old" documentation style, I don't quite understand this.

 You wrote e.g. {{{ \code{foo} }}} which is the old LaTeX style. It should
 be using the Sphinx markup now.

 > Here is a complete (except for XGCD) list of performance comparisons,
 using the local installation of SAGE 4.1.2.alpha0 plus this patch on my
 laptop (Ubuntu 8.10, Intel Core 2 Duo).  The first few tests, from
 comparison through to power, involve random polynomials f and g of degrees
 2000, the division tests use random polynomials f and d of degrees 800 and
 560, and for the GCD test f and d have degree 60 and 42.  In each case,
 the first output line is for the generic implementation, the second output
 line is for the new implementation using FLINT.

 This is encouraging!

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4000#comment:9>
Sage <http://sagemath.org/>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to