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
PolynomialRing_field.lagrange_polynomial doesn't always return a polynomial #10304
Comments
Attachment: trac_10304_lagrange_poly_in_self.patch.gz |
comment:1
I've put up a patch that should fix the problem, at least in the case of For the
Minh, I've put you on CC, since (I think) you wrote the original code for the |
Author: Mathieu Guay-Paquet |
comment:2
Attachment: trac-10304_reviewer.patch.gz I'm happy with most of attachment: trac_10304_lagrange_poly_in_self.patch, but here are some problems with that patch:
The reviewer patch attachment: trac-10304_reviewer.patch fixes all of the above issues. If you're OK with my patch, then set the ticket to positive review. See the ticket description for instructions on which patches to apply and in which order. |
This comment has been minimized.
This comment has been minimized.
Reviewer: Minh Van Nguyen |
comment:3
I thought the use of a mutable default was safe, since it is always copied, never modified. But since there's an idiom against this, I'm happy to comply! And thanks for fixing the documentation issues. Positive review for the reviewer patch. |
Merged: sage-4.6.1.alpha3 |
The function
PolynomialRing_field.lagrange_polynomial
sometimes returns an element of the coefficient ring or even a python int instead of an element of the polynomial ring. This can lead to problems if the caller was expecting a polynomial.The return value is a python int if the list of points was empty, an element of the base ring if the list of points had one point, and an element of the polynomial ring if the list of points had more than one point.
There are similar problems with the base case for the
algorithm='neville'
version:Note that in this case, the return value is not even a list when the list of points was empty.
Apply:
CC: @sagetrac-mvngu
Component: algebra
Keywords: polynomial ring, lagrange polynomial
Author: Mathieu Guay-Paquet
Reviewer: Minh Van Nguyen
Merged: sage-4.6.1.alpha3
Issue created by migration from https://trac.sagemath.org/ticket/10304
The text was updated successfully, but these errors were encountered: