#4000: Implement QQ['x'] via Flint ZZ['x'] + denominator
---------------------------------------------------+------------------------
   Reporter:  malb                                 |       Owner:  somebody    
       Type:  enhancement                          |      Status:  needs_review
   Priority:  major                                |   Milestone:  sage-4.3.2  
  Component:  basic arithmetic                     |    Keywords:              
     Author:  Sebastian Pancratz, Martin Albrecht  |    Upstream:  N/A         
   Reviewer:                                       |      Merged:              
Work_issues:                                       |  
---------------------------------------------------+------------------------

Comment(by spancratz):

 I am sorry for only getting on with this today.  Just now I tried to re-
 produce the problem in plain C with FLINT, but needless to say, I didn't
 manage.  A simple-minded reproduction of the relevant code executed in no
 time and without any problems.  Currently, I am completely out of ideas on
 how to fix this problem.  That's why I'll raise the issue on sage-devel
 and conclude this message with a description of the behaviour that I
 experience on my machine (Lenovo T500 laptop, Intel Core2 Duo CPU, Ubuntu
 9.10):

 After applying all patches from this ticket to a 4.3.1.rc0 installation,
 modify the ``else`` block from line 882 in
 ``sage/libs/flint/fmpq_poly_linkage.pxi`` to the following:
 {{{
             print "In case 3B"
             t = fmpz_init(limbs)
             print "den_fit_limbs"
             __fmpq_poly_den_fit_limbs(r, limbs + fmpz_size(a.den))
             print "pow_ui"
             fmpz_pow_ui(t, lead, m)
             print "mul"
             fmpz_mul(r.den, t, a.den)
             print "clear"
             fmpz_clear(t)
 }}}
 This only includes the ``print`` commands.

 Then, upon executing the same sequence of commands that produce the crash
 in Alex' previous message, I receive the following output:
 {{{
 sage: R.<x> = QQ[]
 sage: f = 3/2*x - 1/3
 sage: %time _ = f % f
 In case 3B
 den_fit_limbs
 pow_ui
 mul
 clear
 CPU times: user 19.10 s, sys: 0.54 s, total: 19.64 s
 Wall time: 19.72 s
 }}}

 What I find very strange (besides the fact that this takes 20s to obtain
 the correct result) is that there are two very noticeable delays of a
 couple of seconds, one after the output ``"pow_ui"``, and another after
 the output of ``"mul"``.

 Sebastian

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