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
Fixes, cleanup and improvements to the default evaluation method for univariate polynomials #18282
Comments
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:8
If I understand correctly, you now make this evaluate to -1 on this: The method you're calling is evaluating a univariate polynomial over an arbitrary ring. You don't know what "evaluation" of the coefficient would mean and, more importantly, whether it's supported at all. Furthermore, the rings in which the answer is supposed to lie likely don't exist yet. Letting sage choose which rings should be constructed likely leads to difficult to predict behaviour (you'd basically be relying on the common parents the coercion framework cooks up, and then I think it's better to let the user rely on it him/herself). I think that |
comment:9
Replying to @nbruin:
Yes:
Note that the previous implementation wouldn't work in the case of
Not exactly:
The logic here is that yes, I have evaluated x, so the evaluated coefficients lie in ℚ, but then I'm evaluating the resulting element of ℚ[Y] on y ∈ ℚ[x][y], not y ∈ ℚ[y]. So the answer should lie in ℚ[x][y]. In contrast,
since
Well, yes, but that's already the case when you just do
Perhaps, yes, but I didn't invent this feature. It has been present for years, and people use it! There are even examples in the sage library that rely on |
comment:10
Replying to @mezzarobba:
OK, that seems to be the case indeed. Thanks for cleaning things up a bit. |
Changed branch from u/mmezzarobba/wip/pol_of_symb to u/mmezzarobba/pol_call |
comment:14
Rebased. |
comment:15
In view of #18600 (and older sisters #18518 and #18585), I think What do you think of my proposal? |
comment:16
Replying to @bgrenet:
Sounds reasonable—or perhaps one should override |
comment:17
Replying to @mezzarobba:
Actually, I did some tests. It appears that it should be better to implement a I'd better let this ticket as it is (and actually try to review it...) and open a new ticket for sparse polynomials. |
Changed branch from u/mmezzarobba/pol_call to public/18282 |
Reviewer: Ralf Stephan |
comment:19
In Pynac-0.4.3 (maybe 0.3.9.3) As I trust Nils on the general purpose, and I can see nothing missing in the code, also the patchbot is happy and my patch is only a doctest change I'll take the liberty to set positive. New commits:
|
Changed branch from public/18282 to |
comment:21
Thanks! |
Changed commit from |
Simplify
Polynomial.__call__()
, fix the following issues (note that in calls of the formp(x,y,...)
,x
is the outermost variable), and add a few tests.Also implement a method to compute the Horner form of a polynomial expression, in order not to lose the “feature” illustrated in the last example.
CC: @rwst @jpflori
Component: commutative algebra
Author: Marc Mezzarobba
Branch:
8ed1967
Reviewer: Ralf Stephan
Issue created by migration from https://trac.sagemath.org/ticket/18282
The text was updated successfully, but these errors were encountered: