-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
ENH: Augment ufunc.reduce with state #8773
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
Comments
An alternative way to implement this might be to just allow the ufunc to modify its |
Gufuncs already provide a more general solution here, don't they?
Is a single pass algorithm actually the most efficient way to implement
n-way GCD?
|
@njsmith : I was wrong about gcd - Yes, |
This makes me realize I should get back to #8819, implementing |
This would also make things like You would have to output the |
Looking at this again, the logical path would seem to be a |
Uh oh!
There was an error while loading. Please reload this page.
Right now,
reduce
can be roughly described as:Or diagramatically:
What I'm proposing is a more powerful variant that allows extra state to be preserved between each function call:
This makes ufuncs capable of describing:
argmin
argmax
*gcd
(ENH: Integer gcd function #8772)The text was updated successfully, but these errors were encountered: