#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 spancratz):

 Hi Martin,

 I am sorry for that.  Last night and this morning I fixed another couple
 of bugs.  In a few minutes, I'll upload a new patch (or rather, again the
 difference from the 20090911 patch).  By the way, for debugging purposes
 all methods in the linkage file now begin with printing the method's name
 (although in all but the floordiv method, that line begins with '#').

 Random (performance!, not correctness...) tests ran fine last night for
 polynomials of degree 2000 for the methods ==, <, +, -, neg, *, ^.  I
 thought the three division methods should work fine now, until I stumbled
 across the following segfault:

     {{{
     sage: S.<y> = QQ[]
     sage: f = -3 * y^10 - 4 * y^9
     sage: g = (1/2) * y^6 + 3 * y^5 + 160930 * y^4
     sage: f // g
     celement_floordiv
     Perform pseudo division -3*x^10-4*x^9 x^6+6*x^5+321860*x^4


     ------------------------------------------------------------
     Unhandled SIGSEGV: A segmentation fault occured in SAGE.
     This probably occured because a *compiled* component
     of SAGE has a bug in it (typically accessing invalid memory)
     or is not properly wrapped with _sig_on, _sig_off.
     You might want to run SAGE under gdb with 'sage -gdb' to debug this.
     SAGE will now terminate (sorry).
     ------------------------------------------------------------
     }}}

 This strikes me as very odd because the segfault seems to occur in the
 call ``fmpz_poly_pseudo_div(q.num, &m, a.num, b.num)`` with ``a.num`` the
 polynomial ``-3*x^10-4*x^9`` and ``b.den`` the polynomial
 ``x^6+6*x^5+321860*x^4``.  Perhaps you could have a look at this one?

 I haven't looked at the two gcd methods yet, but I'll do that later today
 or tomorrow.

 As the last question about the implementation (for this method), I noticed
 that polynomials over QQ in SAGE have the method ``denominator``, which
 clearly this implementation should overwrite.  On which level/ in which
 file should this be done?

 Finally, here are the performance timings, in each case for ten random
 polynomials of degree 2000, first the time for the generic implementation
 and then the time for this implementation with FLINT:

 - ``==`` -  20µs, 1µs
 - ``<`` -  20µs, 1µs
 - ``+`` -  400µs, 100µs
 - ``-`` -  400µs, 100µs
 - ``neg`` -  20ms, 20µs
 - ``*`` -  500ms, 1ms
 - ``^`` (to the 4th power) -  15s, 30µs

 Kind regards,

 Sebastian

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4000#comment:16>
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