<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'>&gt; +    for (size_t j = 0; j &lt; tree.NumChildren(); j++)
&gt; +    {
&gt; +      if (j == i)
&gt; +        continue;
&gt; +      success = false;
&gt; +      // Two nodes overlap each other if and only if there are no dimension
&gt; +      // in which they do not overlap each other.
&gt; +      for (size_t k = 0; k &lt; tree.Bound().Dim(); k++)
&gt; +      {
&gt; +        if ((tree.Child(i).Bound()[k].Lo() &gt;=
&gt; +            tree.Child(j).Bound()[k].Hi()) ||
&gt; +            (tree.Child(j).Bound()[k].Lo() &gt;=
&gt; +            tree.Child(i).Bound()[k].Hi()))
&gt; +        {
&gt; +          success = true;
&gt; +          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&amp; sorted, size_t splitIndex, ElemType&amp; area1, ElemType&amp; area2, ElemType&amp; overlappedArea)</code>)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<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>