-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add storage/kdtree #10
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10 +/- ##
==========================================
+ Coverage 71.60% 76.33% +4.72%
==========================================
Files 17 18 +1
Lines 789 883 +94
==========================================
+ Hits 565 674 +109
+ Misses 191 176 -15
Partials 33 33
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just left some minors comments.
pc/storage/kdtree/kdtree.go
Outdated
|
||
var left, right *node | ||
if mid > 0 { | ||
left = newNode(ra, indice[0:mid], depth+1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[optional] Maybe it is better to be explicit but indice[0:mid]
could just be indice[:mid]
I believe.
pc/storage/kdtree/kdtree.go
Outdated
left = newNode(ra, indice[0:mid], depth+1) | ||
} | ||
if mid+1 < len(indice) { | ||
right = newNode(ra, indice[mid+1:len(indice)], depth+1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[optional] Same here for indice[mid+1:len(indice)]
. It could be indice[mid+1:]
pc/storage/kdtree/kdtree_test.go
Outdated
it.SetVec3(mat.Vec3{1, 0, 0}) // 5 | ||
it.Incr() | ||
it.SetVec3(mat.Vec3{6, 2, 1}) // 6 | ||
it.Incr() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the call to it.Incr()
is not necessary here.
Planning to use it for ICP registration.