-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
provide xgcd for new polynomial rings through _xgcd_univariate_polynomial #13629
Comments
Attachment: trac_13629.patch.gz |
comment:4
I want to remove {{self}} from the docstrings. |
Branch: u/niles/ticket/13629 |
comment:7
rebased to sage 6.0 and converted to git branch; no other changes merges cleanly in local repository in spite of what trac says New commits:
|
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:9
the arguments for |
Changed branch from u/niles/ticket/13629 to u/saraedum/ticket/13629 |
Changed keywords from none to sd59 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Changed branch from u/saraedum/ticket/13629 to u/pbruin/13629-xgcd_univariate_polynomial |
Reviewer: Peter Bruin |
comment:24
I implemented |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:26
I'm happy with the current state of the ticket, but it is probably good if someone checks my last two commits before this can get a positive review. |
comment:27
With the current state of this ticket, there are two implementations of
I note that the exact same questions are equally relevant for the positive-reviewed (by myself!) ticket #18461. I simply did not think of that issue before. |
comment:28
Replying to @bgrenet:
The implementation in The latter situation is sometimes detected only at runtime:
I suspect it is a feature (to avoid a potentially costly primality test) and not a bug that the method only appears after we have forced
I think it is, as the above example shows.
I did have the above picture in mind when working on both tickets, and I am afraid the situation is unavoidable without lots of refactoring. One thing that could be done to reduce duplication is making |
comment:29
Replying to @pjbruin:
OK, thank you for the explanation.
I am not sure what would be the best solution to avoid code duplication in such cases, though I totally agree that it does not belong to this ticket! I'm running tests to check everything is OK. |
comment:30
The current branch does not pass the tests. The failed test is in sage: for A in (RR, CC, QQbar):
....: g = A._gcd_univariate_polynomial
....: R.<x> = A[]
....: z = R.zero()
....: assert(g(2*x, 2*x^2) == x and
....: g(z, 2*x) == x and
....: g(2*x, z) == x and
....: g(z, z) == z) More precisely, I've got the following severe bug: sage: R.<x> = RR[]
sage: z, h = R(0), R(1/2)
sage: (xx, hh, zz) = RR._xgcd_univariate_polynomial(2*x, 2*x^2)
sage: zz == z
False
sage: zz-z
BOOOM! (SegFault) The crash log is empty. |
comment:32
Replying to @pjbruin:
Hmmm, there my git knowledge is not sufficient I guess. So let me take the opportunity to ask a few questions:
Thanks in advance! |
Changed reviewer from Peter Bruin to Peter Bruin, Bruno Grenet |
comment:33
OK, I've been able to test the ticket with #18467 merged and all tests pass. This is fine to me! |
comment:34
Replying to @bgrenet:
People have differing opinions about this; I prefer to avoid unnecessary merge commits.
If you used the command as in (1) this should not be necessary, but in general you can do |
comment:35
Thank you for the clarifications. One point still: Replying to @pjbruin:
Doesn't this modify my local My question though: Isn't it dangerous to modify the local Thanks again! |
comment:36
Replying to @bgrenet:
Yes, I should have said that you should create a new branch first, which seems to be what you did (but be careful to check out the branch first with |
comment:37
Replying to @pjbruin:
Right, I did not mention the |
Changed branch from u/pbruin/13629-xgcd_univariate_polynomial to |
Currently, to add xgcd functionality for a new polynomial ring, one needs to add a specialized subclass of PolynomialElement.
The attached patch allows rings to provide a
_xgcd_univariate_polynomial
method which will be called by PolynomialElement to compute xgcds.This is similar to #10635, #13442.
Depends on #13628
Depends on #18461
Depends on #18467
CC: @sagetrac-boerner
Component: basic arithmetic
Keywords: sd59
Author: Julian Rueth
Branch/Commit:
828b5fc
Reviewer: Peter Bruin, Bruno Grenet
Issue created by migration from https://trac.sagemath.org/ticket/13629
The text was updated successfully, but these errors were encountered: