Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Refactor subs() of multivariate polynomials for readability and efficiency #35210
Refactor subs() of multivariate polynomials for readability and efficiency #35210
Changes from 2 commits
1c436bd
d49f43b
8e03691
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This appears to be more general than the old code that tries to coerce every
v
intoparent._base
.Is this just incidental, or is there a use case for this greater generality?
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.
Perhaps there is no difference in this respect. Both first try to coerce every
v
intoparent._base
. If fails, the old code finds the common parent inreturn self(*g)
(the last line) via the constructor__init__
while the new code does the same in the place. However, for some paths (substitutions with constant values), the new code does not make a duplicate call tosingular_polynomial_call
by avoiding going through the constructor. (if I remember correctly...)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.
Perhaps it is the substitution with constant values that results in zero that makes the duplicate call.