Skip to content
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

Feature request: reverse and rotate functions #364

Open
maxrothman opened this issue Jan 4, 2024 · 2 comments
Open

Feature request: reverse and rotate functions #364

maxrothman opened this issue Jan 4, 2024 · 2 comments

Comments

@maxrothman
Copy link

core.matrix has pretty good coverage of the APL primitives, but one notable exception is the reverse function (monadic ⌽ and ⊖). For 2d matrices with native Clojure sequences, one can work around the problem with (map reverse m), but it’d be nice to have non-abstraction-breaking core.matrix versions of these.

In a similar vein, there’s also no rotate functions. While you can work around this with (transpose (reflect m)), I suspect that a library implementation could achieve better performance.

@mikera
Copy link
Owner

mikera commented Jan 9, 2024

Makes sense. Any preference for API? Remembering of course that arbitrary subsets of dimensions might get reversed or rotated.....

@maxrothman
Copy link
Author

No particular preference! The multiple dimensions part definitely needs to be taken into account. I'd assume you don't want to make APL's mistake by splitting ⌽ and ⊖ as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants