Skip to content
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

Open
sagetrac-spancratz mannequin opened this issue Sep 15, 2009 · 4 comments
Open

GCD, XGCD for polynomial rings with templating #6941

sagetrac-spancratz mannequin opened this issue Sep 15, 2009 · 4 comments

Comments

@sagetrac-spancratz
Copy link
Mannequin

sagetrac-spancratz mannequin commented Sep 15, 2009

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 that gcd(a,0) == a and gcd(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 the celement_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

@malb
Copy link
Member

malb commented Sep 17, 2009

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?

@sagetrac-spancratz
Copy link
Mannequin Author

sagetrac-spancratz mannequin commented Sep 19, 2009

comment:2

Replying to @malb:

The patch looks good, applies cleanly and doctests pass. However, do we really need to mimic the old behaviour?

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

@malb
Copy link
Member

malb commented Sep 29, 2009

comment:3

Maybe we can ask the person who wrote that code?

@aghitza aghitza added this to the sage-4.3 milestone Nov 17, 2009
@robertwb
Copy link
Contributor

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.

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants