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
ENH: linalg: Cythonize id_dist
FORTRAN code
#20558
base: main
Are you sure you want to change the base?
Conversation
I'm currently traveling for work so apologies for the piece meal code written mostly on the planes. I'll finish it off quicker when I am at the sea level. |
[skip ci]
6f53bfe
to
69d7e22
Compare
id_dist
FORTRAN code
id_dist
FORTRAN codeid_dist
FORTRAN code
The main real valued functions are translated and I'll finish off the complex and We probably should get rid of all these functions at some point and use the proper contemporary randomized algorithms because I can't decode the rationale behind some of the steps done in the F77 code (one such example is Consequently, I can't rewrite in proper vectorized Python and need to keep some scalar loops. Thus, I'll try to be faithful to the original F77 here and don't go overboard with squeezing for performance at this time of the translation. |
Reference issue
Closes #18367
Closes #20452
Closes #20609
Part of #18566
What does this implement/fix?
Replaces the infamous id_dist code with its Python equivalent.
Additional information
Currently only Python version is being added. The performance difference is about 60x slower which means a Cython or Pythran version will be on par with the original version which is losing much of its magic at f2py bridge. Frankly, this code should never made its way into SciPy in its current form. The method is pretty much rock solid but the code is very haphazard.
There are also additional functions made public which are
seed
andrand
. The new code is acceptingGenerator
s so not sure how to deprecate them yet. I'll save it until the translation is finished.