<p>In <a href="https://github.com/mlpack/mlpack/pull/699#discussion_r68977015">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>There is a function <code>DoBoundsIntersect</code> in <code>tree_test.cpp</code> that does the same thing, but now that we have two places in the codebase where we are comparing <code>HRectBound</code> objects to see that they overlap, do you think we should add a new member to <code>HRectBound</code> to encapsulate this functionality?  We could call it <code>HRectBound::Contains(const HRectBound&amp; other)</code>, since there is already an overload for a single point instead of a bound.</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#r68977015">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFAr25ngCxniAADg_Nk4ehxUchWItks5qQpi4gaJpZM4I3ATw">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFLHA56s2X_05BLHqp-m0B80AWPoQks5qQpi4gaJpZM4I3ATw.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#r68977015"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>