<p>In <a href="https://github.com/mlpack/mlpack/pull/699#discussion_r68982110">src/mlpack/tests/rectangle_tree_test.cpp</a>:</p>
<pre style='color:#555'>> + 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;
</pre>
<p>I guess <code>HRectBound::Intersect</code> or <code>HRectBound::Overlap</code> probably is a better name, how do you think?<br>
Moreover, <code>r_start_tree_split_impl.hpp</code>, <code>x_tree_split_imp.hpp</code> and <code>minimal_coverage_sweep_impl.hpp</code> 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.<br>
The code is slightly different in <code>MinimalCoverageSweep</code> (it takes into account that bounds can be empty). Maybe we should add this functionality to <code>HRectBound</code>. (something like this: <code>HRectBound::MeasureSplitCoverageOverlap(TreeType* node, SortStruct& sorted, size_t splitIndex, ElemType& area1, ElemType& area2, ElemType& overlappedArea)</code>)</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/699/files/e165d759f9ae612b9965f70fbbf8abdb19dc8d07#r68982110">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFLrnbH2nXqrXS3CSerBMmdHUOF6sks5qQp91gaJpZM4I3ATw">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFDaI2fbSyXhRFDcrMg069qSqU3AMks5qQp91gaJpZM4I3ATw.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/699/files/e165d759f9ae612b9965f70fbbf8abdb19dc8d07#r68982110"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>