NearestNeighbors.jl icon indicating copy to clipboard operation
NearestNeighbors.jl copied to clipboard

Not working with Adjoint type?

Open kirtsar opened this issue 6 years ago • 3 comments

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?

kirtsar avatar Feb 26 '19 13:02 kirtsar

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

KristofferC avatar Feb 26 '19 13:02 KristofferC

@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?

kirtsar avatar Feb 26 '19 20:02 kirtsar

See https://github.com/KristofferC/NearestNeighbors.jl/issues/13, there was some work towards it at https://github.com/KristofferC/NearestNeighbors.jl/pull/14.

KristofferC avatar Feb 27 '19 09:02 KristofferC