#18585: Comparison of sparse polynomials
-------------------------------------+-------------------------------------
       Reporter:  bruno              |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.9
      Component:  commutative        |   Resolution:
  algebra                            |    Merged in:
       Keywords:  polynomials        |    Reviewers:  Vincent Delecroix
        Authors:  Bruno Grenet       |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  3121374eed7b683bd135e9ec5086aac03c4c8eb5
  u/bruno/compare_sparse_polynomials |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by vdelecroix):

 Replying to [comment:17 bruno]:
 > Replying to [comment:14 vdelecroix]:
 > > In
 > > {{{
 > >             if c > 0:
 > >                 c1 = cmp(d1[k1], 0)
 > >                 if c1: return c1
 > > }}}
 > > Isn't `c1` automatically nonzero? Could there be some zero
 coefficients in the dictionary?
 >
 > {{{
 > sage: R.<x> = PolynomialRing(ZZ, sparse=True)
 > sage: p = R({0:1, 1:0, 2:1}, check=False)
 > sage: p
 > x^2 + 1
 > sage: p.dict()
 > {0: 1, 1: 0, 2: 1}
 > }}}
 > I doubt this happens often in practice, but since this is possible, I am
 quite reluctant to remove the test.

 Dough! I was asking because for sparse matrices it is explicitely
 mentioned in the specification that no value can be zero. And this is very
 useful!

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