[mlpack-git] [mlpack/mlpack] R+ and R++ trees implementation (#699)

Ryan Curtin notifications at github.com
Wed Jun 29 12:09:28 EDT 2016


> +    for (size_t j = 0; j < tree.NumChildren(); j++)
> +    {
> +      if (j == i)
> +        continue;
> +      success = false;
> +      // Two nodes overlap each other if and only if there are no dimension
> +      // in which they do not overlap each other.
> +      for (size_t k = 0; k < tree.Bound().Dim(); k++)
> +      {
> +        if ((tree.Child(i).Bound()[k].Lo() >=
> +            tree.Child(j).Bound()[k].Hi()) ||
> +            (tree.Child(j).Bound()[k].Lo() >=
> +            tree.Child(i).Bound()[k].Hi()))
> +        {
> +          success = true;
> +          break;

There is a function `DoBoundsIntersect` in `tree_test.cpp` that does the same thing, but now that we have two places in the codebase where we are comparing `HRectBound` objects to see that they overlap, do you think we should add a new member to `HRectBound` to encapsulate this functionality?  We could call it `HRectBound::Contains(const HRectBound& other)`, since there is already an overload for a single point instead of a bound.

---
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/699/files/e165d759f9ae612b9965f70fbbf8abdb19dc8d07#r68977015
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160629/961925de/attachment.html>


More information about the mlpack-git mailing list