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

Dyadic mapslices #5140

Closed
mschauer opened this issue Dec 14, 2013 · 2 comments
Closed

Dyadic mapslices #5140

mschauer opened this issue Dec 14, 2013 · 2 comments

Comments

@mschauer
Copy link
Contributor

It would be a nice feature if mapslices could have a dyadic counterpart (like map has map(f, a, b)) which takes two matrices A and B and two slices and applies the two argument function f to pairs of slices of A and B.

Many operations can be expressed in that form, as a silly example left and right matrix multiplication by a diagonal matrix diagm(d) would correspond to mapslices(.*, A, 1, d, 1) respective mapslices(.*, A, 2, d, 1)

@mschauer
Copy link
Contributor Author

I took a second look at mapslices, I can translate that into the dyadic case.

@mschauer
Copy link
Contributor Author

For monadic mapslices, the images of the slices get stored along the dimensions sliced over. For dyadic mapslices one would rather break that convention (how should that work when slicing over different dimensions in both arguments...) and reorder dimensions so that the sliced dimensions come after the dimensions iterated over. Having a second version of mapslices with different behaviour in base is not so nice. So I close this for now.

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

No branches or pull requests

1 participant