dataset and kdtree - k nearest is checked for min number of k#312
Conversation
| constexpr auto KDTreeParams = defineParameters( | ||
| StringParam<Fixed<true>>("name", "Name"), | ||
| LongParam("numNeighbours", "Number of Nearest Neighbours", 1), | ||
| LongParam("numNeighbours", "Number of Nearest Neighbours", 1, Min(0)), |
There was a problem hiding this comment.
Why is it Min(0) here and Min(1) in DataSet?
|
because 0 in kdtree is 'give me all that respect the distance' and we didn't implement that in DS - which could be its own ticket if we decide to. |
|
in the meantime, the fact that the optional can go negative was crashing, so I fixed both to be consistent for now |
|
@weefuzzy if you are happy with my answer I'll merge this (as it fixes crashes) and add a feature request to align the Knearest between the 2 (adding 0 and range to ds.knearest() which will be good for my stl iterator learning) |
Right, ok, so to do with radius search for kdtree? Fine. |
fixes #184 by adding checks both in the parameter description and at the recup of optional arguments