#18600: Fix several methods for sparse polynomials
-------------------------------------+-------------------------------------
       Reporter:  bruno              |        Owner:
           Type:  defect             |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.9
      Component:  commutative        |   Resolution:
  algebra                            |    Merged in:
       Keywords:  sparse polynomial  |    Reviewers:  Vincent Delecroix
        Authors:  Bruno Grenet       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  ecffcef63b5d0e298af36bd487df165bbf6a42dd
  u/bruno/polynomial_sparse          |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by vdelecroix):

 * status:  needs_review => needs_work
 * reviewer:   => Vincent Delecroix
 * milestone:  sage-6.8 => sage-6.9


Comment:

 Hello,

 Some technical comments:

 * `integral`

     What about {{{Q = self.base_ring().fraction_field()}}} instead of {{{Q
 = (self.constant_coefficient()/1).parent()}}}?

     The `.change_ring` method is very slow but this has nothing to do with
 this ticket.

 * `is_unit`

     Why do you care that the base ring being an integral domain? Is `1`
 not a unit in `Z/4Z`? Sage thinks it is
 {{{
 sage: Zmod(4)(1).is_unit()
 True
 }}}

 * `reverse`

     You can use `for k,v in self.__coeffs.iteritems()`

 * `integral` for sparse

     idem: use `iteritems`. In other words, replace
 {{{
 Q({k:self.__coeffs[k].integral(var) for k in self.__coeffs.keys()})
 }}}
     with
 {{{
 Q({k:v.integral(var) for k,v in self.__coeffs.iteritems()})
 }}}
    I found strange that in one case you defined the dictionary `d` and
 then `return Q(d)` while in the other you do everything at once.

 Vincent

--
Ticket URL: <http://trac.sagemath.org/ticket/18600#comment:3>
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 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-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to