Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython_plus_experiments
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
0
Merge Requests
0
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
Julien Jerphanion
cython_plus_experiments
Commits
6f10ad68
Commit
6f10ad68
authored
May 25, 2021
by
Julien Jerphanion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused datastructure and debugging
parent
1538c72a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
13 deletions
+3
-13
kdtree/kdtree.pyx
kdtree/kdtree.pyx
+1
-12
kdtree/main.py
kdtree/main.py
+2
-1
No files found.
kdtree/kdtree.pyx
View file @
6f10ad68
...
@@ -128,9 +128,6 @@ cdef cypclass KDTree:
...
@@ -128,9 +128,6 @@ cdef cypclass KDTree:
I_t
d
# number of dimensions / features
I_t
d
# number of dimensions / features
I_t
depth
# max_depth of the tree (to be unified with leaf_size)
I_t
depth
# max_depth of the tree (to be unified with leaf_size)
np
.
ndarray
data_arr
np
.
ndarray
idx_array_arr
active
Node
root
active
Node
root
D_t
*
data_ptr
D_t
*
data_ptr
...
@@ -179,13 +176,7 @@ cdef cypclass KDTree:
...
@@ -179,13 +176,7 @@ cdef cypclass KDTree:
depth
,
n_dims
=
d
,
dim
=
0
,
start
=
0
,
end
=
n
)
depth
,
n_dims
=
d
,
dim
=
0
,
start
=
0
,
end
=
n
)
scheduler
.
finish
()
scheduler
.
finish
()
del
scheduler
for
i
in
range
(
n
):
printf
(
"X[indices[%d] = %d]= %f %f
\
n
"
,
i
,
self
.
indices_ptr
[
i
],
self
.
data_ptr
[
self
.
indices_ptr
[
i
]
*
d
],
self
.
data_ptr
[
self
.
indices_ptr
[
i
]
*
d
+
1
])
void
__dealloc__
(
self
):
void
__dealloc__
(
self
):
printf
(
"Deallocating KDTree datastructures
\
n
"
)
printf
(
"Deallocating KDTree datastructures
\
n
"
)
...
@@ -196,7 +187,5 @@ cdef cypclass KDTree:
...
@@ -196,7 +187,5 @@ cdef cypclass KDTree:
cdef
public
int
main
()
nogil
:
cdef
public
int
main
()
nogil
:
# Entry point for the compiled binary file
# Entry point for the compiled binary file
printf
(
"main: called
\
n
"
)
printf
(
"empty public int main() nogil:"
)
tree
=
KDTree
()
printf
(
"main: done
\
n
"
)
return
0
return
0
kdtree/main.py
View file @
6f10ad68
...
@@ -2,10 +2,11 @@ import numpy as np
...
@@ -2,10 +2,11 @@ import numpy as np
import
kdtree
import
kdtree
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
n
,
d
=
24
,
2
n
,
d
=
1000000
,
2
golden_ratio
=
(
1
+
5
**
0.5
)
/
2
golden_ratio
=
(
1
+
5
**
0.5
)
/
2
X
=
np
.
zeros
((
n
,
d
))
X
=
np
.
zeros
((
n
,
d
))
for
i
in
range
(
n
):
for
i
in
range
(
n
):
X
[
i
,
0
]
=
(
i
/
golden_ratio
)
%
1
X
[
i
,
0
]
=
(
i
/
golden_ratio
)
%
1
X
[
i
,
1
]
=
i
/
n
X
[
i
,
1
]
=
i
/
n
tree
=
kdtree
.
KDTree
(
X
,
depth
=
10
)
tree
=
kdtree
.
KDTree
(
X
,
depth
=
10
)
del
tree
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