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

pairwise for arrays of arrays #152

Closed
theogf opened this issue Oct 16, 2019 · 2 comments · Fixed by #194
Closed

pairwise for arrays of arrays #152

theogf opened this issue Oct 16, 2019 · 2 comments · Fixed by #194

Comments

@theogf
Copy link
Contributor

theogf commented Oct 16, 2019

It would be nice to be able to be able to deal with arrays of arrays as well.
For example :

A = [rand(3) for _ in 1:3]
P = pairwise(SqEuclidean(),A)
# Where pairwise(SqEuclidean(),hcat(A,...),dims=2) == P

In this case one could of course simply concatenate vectors, but for more complex objects (not necessarily real vectors) that would broaden the use of pairwise!
I could make a PR if you think that makes sense

@mkborregaard
Copy link
Contributor

And please also Iterators and generators :-)

@yakir12
Copy link

yakir12 commented Oct 16, 2020

+1 this would also allow for collections of StaticVectors (as in, coordinates).

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

Successfully merging a pull request may close this issue.

3 participants