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

Ryan Curtin notifications at github.com
Wed Jun 29 16:29:27 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;

Hm, I would expect `Intersect()` to actually return the bound intersection (an `HRectBound` not a `bool`) and I would expect `Overlap()` to return the amount of volume of the overlap.  I see your concern though, because it is not clear if `Contains()` means "contains entirely" or "contains partially".  We could also implement `Overlap()` to return the volume of the overlap and check if it is 0, too, and maybe that would work.

To the second point, I agree, we could add that functionality to `HRectBound` if it is duplicated.

---
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#r69021117
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160629/138603f3/attachment.html>


More information about the mlpack-git mailing list