Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
K
kdtree
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cython-plus
kdtree
Commits
200c7252
Commit
200c7252
authored
Mar 28, 2022
by
Julien Jerphanion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify Minimal Reproducible Example
parent
1ff05f71
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
665 deletions
+37
-665
debug.py
debug.py
+24
-0
kdtree.pyx
kdtree.pyx
+12
-664
runtime
runtime
+1
-1
No files found.
debug.py
0 → 100644
View file @
200c7252
import
kdtree
import
numpy
as
np
from
sklearn
import
neighbors
if
__name__
==
"__main__"
:
X
=
np
.
load
(
"X.npy"
)
tree
=
kdtree
.
KDTree
()
n_query
=
10
k
=
3
rng
=
np
.
random
.
RandomState
(
0
)
Y
=
rng
.
rand
(
n_query
,
X
.
shape
[
1
])
knn_indices
=
np
.
zeros
((
n_query
,
k
),
dtype
=
np
.
int32
)
knn_distances
=
np
.
zeros
((
n_query
,
k
),
dtype
=
np
.
float64
)
tree
.
query
(
Y
,
knn_indices
,
knn_distances
)
# print(knn_distances)
sktree
=
neighbors
.
KDTree
(
X
,
leaf_size
=
256
)
knn_distances
,
knn_indices
=
sktree
.
query
(
Y
,
k
=
k
,
return_distance
=
True
)
# print(knn_distances)
kdtree.pyx
View file @
200c7252
This diff is collapsed.
Click to expand it.
runtime
@
4e6e7c2b
Subproject commit
33678cf7a06ea219cfcfc9027c4d47ab4c519c
13
Subproject commit
4e6e7c2bb8a149984ccdbe72b851ab5975769a
13
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment