-
-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure degree and total degree return Integer
type for MPolynomial_polydict
class
#37611
Ensure degree and total degree return Integer
type for MPolynomial_polydict
class
#37611
Conversation
MPolynomial_polydict
type
MPolynomial_polydict
typeInteger
type for MPolynomial_polydict
class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small change.
For future reference, I considered moving the wrapper on L685 to the underlying PolyDict, but that is not desirable since polydict
is a "general" dictionary-like class and hence should be fast.
This is why I didnt make a patch for |
Thanks! |
Documentation preview for this PR (built with commit a866b12; changes) is ready! 🎉 |
…s type `Integer` for `MPolynomialRing_libsingular` class Previously the degree of multivariate polynomials was returned as a python `int` instead of a SageMath `Integer` resulting in ugly `ZZ(f.degree())` calls in various places. This PR only focuses on the case of `MPolynomialRing_libsingular` to keep the noise of the PR as low as possible. **Future work**: This same issue is in `MPolynomial_polydict`, I am happy to also do the work here, or make a new PR -- really I don't like sage returning a `int` when we dont have to. **Edit** This follow up work has been done in PR: sagemath#37611 URL: sagemath#37605 Reported by: Giacomo Pope Reviewer(s): Matthias Köppe
This is a follow up PR to #37605 which ensures that
degree()
andtotal_degree()
return a sageInteger
type instead of a pythonint
for theMPolynomial_polydict
class.However,
f.degrees()
returns something of typesage.rings.polynomial.polydict.ETuple
which has elements asint
. I am loathed to change this to returnInteger
in case of performance regression, so the following status ofMPolynomial_polydict
is the following:I would like advice on how to proceed with the
degrees()
function. Is leaving it in it's current state OK?Fixes #37603