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
Fast computation of Stirling numbers of 2nd kind #9663
Comments
comment:2
Please explain the massive number of changes to module_list.py of the form:
|
comment:3
Oops, my editor was set to "strip trailing whitespace when saving files". |
fast implementation of stirling_number2 -- updated patch |
comment:4
Attachment: stirling2.patch.gz Please see the new version of the patch. |
Changed author from fredrik.johansson to Fredrik Johansson |
Reviewer: Nathann Cohen |
comment:5
Nice one !! I learned many things while reviewing this patch Would you mind adding this small doctest in the patch I attach ? If not, you can set this ticket to "positive_review" ! Thanksssssssssssss !!! Nathann |
Attachment: trac_9663 - additional test.patch.gz |
comment:6
Are you around ? There's basically nothing to do on this patch Nathann |
Changed reviewer from Nathann Cohen to Nathann Cohen, Nicolas Borie |
comment:7
The two patch applied on 4.5.3 All tests pass, no warning in docbuild... Nice documentation, powerful implantation... Good job! I give the two patch a positive review. For the release manager, please apply :
|
Changed author from Fredrik Johansson to Fredrik Johansson, Nathann Cohen |
comment:8
I think you should add a patch with a test for "unknown algorithm". |
comment:10
Also, please do not put spaces in patch filenames. |
comment:11
Replying to @jdemeyer:
What do you mean ? Nathann |
comment:12
Replying to @nathanncohen:
A test which does something like
to check the "unknown algorithm" code. |
comment:13
Here is a new version of my patch with the requested doctest. Nathann |
comment:14
Replying to @nathanncohen:
On line 670, |
Changed reviewer from Nathann Cohen, Nicolas Borie to Nathann Cohen, Nicolas Borie, Jeroen Demeyer |
comment:15
Done. Nathann |
Attachment: trac_9663-additional_tests.patch.gz |
Merged: sage-4.6.1.alpha0 |
Currently, Stirling numbers are computed by calling GAP. The patch provides fast Cython code for Stirling numbers of the second kind, and allows using GAP or Maxima as an optional algorithm.
By having less overhead, the Cython code is about 10000 times faster than GAP or Maxima for tiny inputs, and it remains much faster than GAP for larger inputs as well. Apparently Maxima uses a fast algorithm unlike GAP, but my code is still about twice as fast as Maxima for huge n due to an algorithmic optimization.
Mathematica seems to be about as slow as GAP (warning: timed on a different system):
CC: @williamstein
Component: combinatorics
Author: Fredrik Johansson, Nathann Cohen
Reviewer: Nathann Cohen, Nicolas Borie, Jeroen Demeyer
Merged: sage-4.6.1.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/9663
The text was updated successfully, but these errors were encountered: