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

lozhnikov notifications at github.com
Wed Jun 29 12:38:13 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;

I guess `HRectBound::Intersect` or `HRectBound::Overlap` probably is a better name, how do you think?
Moreover, `r_start_tree_split_impl.hpp`, `x_tree_split_imp.hpp` and `minimal_coverage_sweep_impl.hpp` contain a piece of almost equal code. I mean the code that computes the total coverage of two sets of nodes (points) and the area of intersection.
The code is slightly different in `MinimalCoverageSweep` (it takes into account that bounds can be empty). Maybe we should add this functionality to `HRectBound`. (something like this: `HRectBound::MeasureSplitCoverageOverlap(TreeType* node, SortStruct& sorted, size_t splitIndex, ElemType& area1, ElemType& area2, ElemType& overlappedArea)`)

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


More information about the mlpack-git mailing list