#17922: coeffs() function more consistent between Expressions and polynomial
rings
-----------------------------+----------------------------
Reporter: JoalHeagney | Owner:
Type: PLEASE CHANGE | Status: new
Priority: minor | Milestone: sage-6.6
Component: algebra | Keywords: coeffs
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
-----------------------------+----------------------------
{{{
y = 3*x^3 + 2*x^2 - 4*x
print(y)
type(y)
}}}
Gives:
{{{
3*x^3 + 2*x^2 - 4*x
<type 'sage.symbolic.expression.Expression'>
}}}
And
{{{
M = matrix(SR,[[1,2],[0,-2]])
ch = M.charpoly()
print(ch)
type(ch)
}}}
gives
{{{
x^2 + x - 2
<class
'sage.rings.polynomial.polynomial_element_generic.Polynomial_generic_dense_field'>
}}}
But:
{{{
y.coeffs()
}}}
returns
{{{
[[−4,1],[2,2],[3,3]]
}}}
and
{{{
ch.coeffs()
}}}
returns
{{{
[−2,1,1]
}}}
I'd prefer if these two functions returned the same format, preferably the
Expression format, as having access to the index allows list comprehension
tastiness.
--
Ticket URL: <http://trac.sagemath.org/ticket/17922>
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.