<p>In <a href="https://github.com/mlpack/mlpack/pull/699#discussion_r69038826">src/mlpack/core/tree/rectangle_tree/r_plus_tree_split_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +    SweepCostType cost;
&gt; +
&gt; +    if (node-&gt;IsLeaf())
&gt; +      cost = SweepType&lt;SplitPolicyType&gt;::SweepLeafNode(k, node, cut);
&gt; +    else
&gt; +      cost = SweepType&lt;SplitPolicyType&gt;::SweepNonLeafNode(k, node, cut);
&gt; +    
&gt; +
&gt; +    if (cost &lt; minCost)
&gt; +    {
&gt; +      minCost = cost;
&gt; +      minCutAxis = k;
&gt; +      minCut = cut;      
&gt; +    }
&gt; +  }
&gt; +  return true;
</pre>
<p>But I think I can produce that behavior for the R++ tree if all the points are 0 in all dimensions. Then <code>SplitLeafNode()</code> in every dimension will be <code>SIZE_MAX</code>. I think a similar thing will happen for non-leaf nodes or for the R+ tree.</p>

<p>I guess in that type of situation, when we cannot split the node, we have to either raise the maximum number of points in each node, or throw an exception. I'd probably lean towards the latter, with a line of output to <code>Log::Warn</code> in order to warn the user.</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#r69038826">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFG8cKk9OLCWetQ0NQfgRBxbVTKU-ks5qQu8egaJpZM4I3ATw">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFGMijl-0T8oq514tCtw0-F9qWDSMks5qQu8egaJpZM4I3ATw.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#r69038826"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>