[mlpack-git] [mlpack/mlpack] Octree (#790)
lozhnikov
notifications at github.com
Mon Oct 3 08:31:28 EDT 2016
lozhnikov commented on this pull request.
> + }
+
+ return bestIndex;
+}
+
+template<typename MetricType, typename StatisticType, typename MatType>
+size_t Octree<MetricType, StatisticType, MatType>::GetNearestChild(
+ const Octree& queryNode) const
+{
+ // It's possible that this could be improved by caching which children we have
+ // and which we don't, but for now this is just a brute force search.
+ ElemType bestDistance = DBL_MAX;
+ size_t bestIndex = NumChildren();
+ for (size_t i = 0; i < NumChildren(); ++i)
+ {
+ const double dist = children[i]->MaxDistance(queryNode);
I think that should be `MinDistance()`, how do you think?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/790#pullrequestreview-2512610
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20161003/d6262984/attachment.html>
More information about the mlpack-git
mailing list