-
-
Notifications
You must be signed in to change notification settings - Fork 564
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
Iterating through Partitions(n) for n>=1000. #14094
Comments
Author: Mike Hansen |
comment:1
Attachment: trac_14094.patch.gz I implemented the algorithm found at http://www.site.uottawa.ca/~ivan/F49-int-part.pdf |
Reviewer: Travis Scrimshaw |
Dependencies: #13605 |
comment:2
Hey Mike, I'm uploading a review patch which moves the functionality into a
I believe the python list will be faster mainly because converting from the C array into the python list will cause frequent memory allocations (see here). I don't know enough cython to do anything different. I also tried pushing the actual implementation into C and pulling back from that, but I would doubt that would net any additional performance increase (anyways, considering we get ~4x increase as is, it will likely be miniscule). I left my C int implementation as comments, feel free to delete. Also I make this ZS iterator be the fast iterator for both If you agree with my implementation, feel free to set this to positive review. Thanks for finding and the first implementation of this algorithm, Travis |
comment:3
Hey Mike, I've updated my patch which fixes the failing doctests. Best, Travis |
comment:4
Rebased patch. |
comment:5
Rebased to remove fuzz for |
comment:6
Your changes look good to me. |
comment:7
Thank you Mike. |
comment:8
|
comment:9
Attachment: trac_14094-partition_iterator-review-ts.patch.gz Fixed:
For patchbot: Apply: [attachment: trac_14094.patch], [attachment: trac_14094-partition_iterator-review-ts.patch] |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Merged: sage-5.9.beta3 |
As discovered live during the Sage Days 45 tutorial, the default fast iterator for Partitions(n) is recursive and breaks for n>988:
Whereas the generic iterator works:
Possible fix: either make the fast iterator non recursive, or default to the generic iterator.
Apply: attachment: trac_14094.patch, attachment: trac_14094-partition_iterator-review-ts.patch
Depends on #13605
CC: @sagetrac-sage-combinat
Component: combinatorics
Keywords: days45
Author: Mike Hansen
Reviewer: Travis Scrimshaw
Merged: sage-5.9.beta3
Issue created by migration from https://trac.sagemath.org/ticket/14094
The text was updated successfully, but these errors were encountered: