-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
GCD, XGCD for polynomial rings with templating #6941
Comments
comment:1
Attachment: trac_6941_monicgcd.patch.gz The patch looks good, applies cleanly and doctests pass. However, do we really need to mimic the old behaviour? |
comment:2
Replying to @malb:
I assume you are referring to the hyperelliptic curves part? Yes, I think so. Otherwise, some doctests fail. I haven't tried to fully understand the mathematics of that part, but it seems to depend on the assumption gcd(a,0) == a. Sebastian |
comment:3
Maybe we can ask the person who wrote that code? |
comment:6
If we need to mimic the old xgcd behavior, it would be much better to abstract that out into its own function with a docstring and some tests. |
GCD and XGCD methods should return monic greatest common divisors. However, at the moment these two methods in the template file
sage/rings/polynomial/polynomial_template.pxi
prevent this by enforcing thatgcd(a,0) == a
andgcd(0,b) == b
.I suggest that the code for these two methods in the template file should only refer to the corresponding
celement_foo
methods of the actual implementation. This way, all the logic is in thecelement_foo
methods, rather than being split between the two levels.The patch for this should touch the template file as well as the two linkage files for GF2X and zmod polynomials.
CC: @rwst @jpflori
Component: algebra
Author: Sebastian Pancratz
Issue created by migration from https://trac.sagemath.org/ticket/6941
The text was updated successfully, but these errors were encountered: