#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: public/18600 | e021276b5e043e066842b4e6e3644d489626deab
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by bruno):
Replying to [comment:16 vdelecroix]:
> - ` if not isinstance(degree, int) and not isinstance(degree, Integer)`
-> `not isinstance(degree, (int,Integer))`.
Done.
> - after `OUTPUT:` in the docstring of `newton_slopes` you should add a
line break
Done.
> - you can do one liners (you are not obliged though)
> {{{
> d = {degree-k: v for k,v in self.__coeffs.iteritems() if degree >= k}
> }}}
Done.
> - why are you keeping a method `newton_slopes` in both
`polynomial_element.Polynomial` and
`polynomial_element_generic.Polynomial_generic_sparse`? The algorithm does
not seem to use much about the sparse structure. Moreover, why their
arguments differ?
The rationale is that for very sparse polynomials, one may want to get the
newton slopes in a "compressed" format, that is as a list of segments
defined by their slope and length rather than as a (very long) list of
length-1 segments solely defined by their slope. I decided to implement
this "compressed" output for sparse polynomials only since this feature
seem(ed) mostly useful for sparse polynomials.
A modification I could do is to move my implementation in the `Polynomial`
class. Do yo think it would be the right thing to do?
--
Ticket URL: <http://trac.sagemath.org/ticket/18600#comment:19>
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.