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

Not working with Adjoint type? #82

Closed
kirtsar opened this issue Feb 26, 2019 · 4 comments
Closed

Not working with Adjoint type? #82

kirtsar opened this issue Feb 26, 2019 · 4 comments

Comments

@kirtsar
Copy link

kirtsar commented Feb 26, 2019

Imagine you have a dataset X, then it is naturally to write something like:

KDTree(Matrix(X)')

It does not working right now. Instead, one should write two times:

KDTree(Matrix(Matrix(X)'))

Can it be fixed?

@KristofferC
Copy link
Owner

Materializing the transpose is likely much better for performance since that keeps the coordinates of a point close in memory.

@kirtsar
Copy link
Author

kirtsar commented Feb 26, 2019

@KristofferC
Oh, i see. and for the same reason the package does not work with sparse arrays?

By the way, KDTree is not working with array of int-s also. Is it intentional?

@KristofferC
Copy link
Owner

See #13, there was some work towards it at #14.

@KristofferC
Copy link
Owner

This works now

julia> KDTree(Matrix(X)')
KDTree{StaticArraysCore.SVector{3, Float64}, Euclidean, Float64, StaticArraysCore.SVector{3, Float64}}
  Number of points: 10
  Dimensions: 3
  Metric: Euclidean(0.0)
  Reordered: true

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

2 participants