#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 just started to look at the gcd methods again and I also looked at the
 logic in polynomial_template.pxi.  Here's the question:

 Since the gcd of two polynomials is only defined up to multiplication by
 rationals, what's the *right* way of dealing with this?  I think one can
 make a good argument for always returning the same normalisation.  This
 would also mean that we do *not* necessarily have gcd(a,0) == a.  This is
 currently the way it's handled in the file polynomial_template.pxi.  If we
 want to normalise the gcd, in which way should this be done?  If it's non-
 zero..

   -  Monic rational polynomial
   -  Primitive integer polynomial with positive leading coefficient

 Of course, there are lots more but I think these two might be the most
 sensible choices.

 The first one has the advantage that it generalises to all polynomial
 rings (over commutative rings with 1, at least).  Upon adding a method
 returning the monic scalar multiple of a polynomial to the template file,
 one can still handle the cases of gcd(a,0) and gcd(0,b) in the template
 file.

 Personally though, I am more in favour of the second option, since this
 might lead to faster code when working with QQ[].  In this case, we should
 remove the handling of the above two cases from the template file and
 always pass the call on to celement_gcd.  This would mean that we leave
 the normalisation up to the actual implementation of the polynomial ring,
 rather than enforcing it across all base rings using the template file.
 We would then also have to make sure that all celement_gcd methods are
 happy to deal with zero arguments.

 What do you think?

 Sebastian

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