<p>There shouldn't be too much duplication in the second option.  We would say that the left child would have type <code>VantagePointTree&lt;BallBound&gt;</code> and the right child would have type <code>VantagePointTree&lt;HollowBallBound&gt;</code>, then we could just specialize <code>TreeTraits</code> for each of those classes with different values for the left and right children.  But, the real difficulty there, which I did not think about earlier, is that what is returned when I call <code>Child(i)</code> is unclear, and there is no way to preserve the type fully.  I can think of some ways, maybe, but it would be a bit backhanded.</p>

<p>The checks for <code>FirstPointIsCentroid</code> are actually used pretty often; at least once in every <code>Score()</code> call.  So it is of some importance that those remain static compile-time constants.  If we were to make those supported as runtime checks in some cases, we would need to</p>

<ul>
<li>change the boolean constants to constexpr functions that take TreeTypes as a parameter</li>
<li>for VP-trees, the function can't be constexpr, but instead looks at whether the TreeType parameter is true or false</li>
</ul>

<p>We already have the fourth option implemented, so it is easy to test. :)</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/708#issuecomment-232151726">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFIcH0DjwE72Ea1wWDMoR5PSZ7RELks5qU-l5gaJpZM4I_COp">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFEfxi91JuUBtkxrpjdkibC172qG1ks5qU-l5gaJpZM4I_COp.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/708#issuecomment-232151726"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>