Update kdtree kr with dist (and refactor)#303
Conversation
|
the 2nd commit also corrects the error for non-triggered kr output post negative triggered output |
It's not calling into already generic code, so there would be some extra work in updating other functions too. Given the amount of other apparatus querying
There's no particular reason to suppose it should work like the query for |
|
thanks for this, pushed the change. Now, I have avoided the TODO at line 108, mostly because I didn't know how to overload a single function with a fork in the end... or maybe I have a private (computeKnearest that is called with a bool argument on output one or the other?) |
|
I have 2 c++ potential improvments to be checked by @weefuzzy here.
happy to learn again - or to merge as is because life is too short |
| BufferAdaptor::ReadAccess(data.get()).samps(0, mAlgorithm.dims(), 0); | ||
| auto [dist, ids] = mAlgorithm.kNearest(point, k, get<kRadius>()); | ||
| return {dist}; | ||
| auto reply = computeKnearest(data, k); |
There was a problem hiding this comment.
You need to check that the result is ok here as well
There was a problem hiding this comment.
oupsy, sorry, added now running the tests
…and 0 to get all ranked, so we just need to check neither are negative.
* first working KDTreeQuery refactor with questions * corrected the error for non-triggered state * wise catch from a wise man * even better when it compiles * formated * 3rd time lucky sorry for the noise * now with a shared function * fix error (no squaring needed here as the algo layer does that for us) * much better / much terser copy * adds the replies * forgot the test there... * this condition used to be commented (with <=) but in effect we use 0 and 0 to get all ranked, so we just need to check neither are negative.
Using the latest refactor in DS.kr, enacted the following changes:
still 2 questions pending:
any pointer (pun intended) welcome