-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
refactor gcd #13441
Comments
Dependencies: #13439 |
comment:2
I also removed |
Changed dependencies from #13438 to none |
This comment has been minimized.
This comment has been minimized.
comment:7
Removed Rational's gcd since it was not used anymore (rational numbers rely on |
comment:9
My main concern is with a speed penalty in doing gcds for rationals, polynomial_integer_dense_ntl, etc. Have you compared the runtime of the gcds before and after your changes? I agree that it's conceptually nicer. |
comment:10
Without the patch I get:
With the patch:
So there is actually a speed penalty. This seems to be caused by a bug in
I'm looking into this. |
comment:12
Replying to @saraedum:
This is just how decorators work on methods (if they don't do tricks like cached_method) - the |
comment:13
The speed problems seem to be resolved with the new patch: Without the patch:
With the patch:
Let's see what the patchbot thinks about it… |
comment:16
Attachment: trac_13441.patch.gz |
comment:17
The patchbot reported some problems with rational numbers. These should be fixed now. |
comment:18
Minor issue: the |
comment:20
A question: is there a good technical reason to make To be honest, I don't really see the (mathematical) point of having a category of Euclidean domains, at least not in its current form. There would presumably need to be some condition requiring the "quotient and remainder" function to be compatible with morphisms in this category, and even then I wonder how useful it would be. Again, maybe there is a good technical reason to have such a category? |
comment:21
IMHO this is precisely what the category framework is about. We aren't talking about mathematical categories, but at non-inheritance framework to ensure consistency. There isn't much use in a stand-alone EuclideanDomains category, but it is definitely useful as a subcategory that you can slap on whenever you have a euclidean domain. Alas, the patch does not apply to Sage 6. Please rebase. |
Branch: u/niles/ticket/13441 |
comment:23
rebased and converted to git branch; no other changes New commits:
|
Commit: |
Changed branch from u/niles/ticket/13441 to u/tscrim/ticket/13441 |
comment:25
I made some review tweaks to the documentation (and it's now based off |
comment:26
Replying to @tscrim:
thanks!
I haven't reviewed this patch, just converted it to a git branch so I can work with it. I can see that it seems to work, and that the documentation builds correctly and looks good. But I haven't looked more closely at it; in particular I haven't verified the timing results. I do give a positive review to your changes -- are you giving positive review to the earlier parts of the patch/branch? |
comment:27
I double-checked and I am getting the same times (up to noise), so then it's positive review all around. |
Reviewer: Niles Johnson, Travis Scrimshaw |
Currently, some classes define a
_gcd
method which is called by agcd
method of euclidean domain elements. Most elements already definegcd
directly, and I see no real use in having this method in between.The attached patch renames all
_gcd
methods togcd
and also streamlines the use of@coerce_binop
on them.This is similar to #13628.
Component: basic arithmetic
Author: Julian Rueth
Branch/Commit: u/tscrim/ticket/13441 @
7cdeebb
Reviewer: Niles Johnson, Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/13441
The text was updated successfully, but these errors were encountered: