<p>In <a href="https://github.com/mlpack/mlpack/pull/699#discussion_r69021117">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>Hm, I would expect <code>Intersect()</code> to actually return the bound intersection (an <code>HRectBound</code> not a <code>bool</code>) and I would expect <code>Overlap()</code> to return the amount of volume of the overlap.  I see your concern though, because it is not clear if <code>Contains()</code> means "contains entirely" or "contains partially".  We could also implement <code>Overlap()</code> to return the volume of the overlap and check if it is 0, too, and maybe that would work.</p>

<p>To the second point, I agree, we could add that functionality to <code>HRectBound</code> if it is duplicated.</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#r69021117">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFMjE2RROH905gvTRD3NdKFZzwxzqks5qQtWngaJpZM4I3ATw">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFPJCmf3AOIzypyo1d1JvDpLAoX2mks5qQtWngaJpZM4I3ATw.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#r69021117"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>