<p>In <a href="https://github.com/mlpack/mlpack/pull/708#discussion_r69545743">src/mlpack/core/tree/binary_space_tree/vantage_point_split_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +      //  Calculate the median value of the distance from the vantage point candidate
&gt; +      //  to these samples
&gt; +      GetMedian(bound, data, samples, vantagePoint, mu);
&gt; +    }    
&gt; +  }
&gt; +  assert(bestSpread &gt; 0);
&gt; +}
&gt; +
&gt; +template&lt;typename BoundType, typename MatType&gt;
&gt; +void VantagePointSplit&lt;BoundType, MatType&gt;::
&gt; +GetDistinctSamples(arma::uvec&amp; distinctSamples, const size_t numSamples,
&gt; +    const size_t begin, const size_t upperBound)
&gt; +{
&gt; +  if (upperBound &gt; numSamples)
&gt; +  {
&gt; +    arma::Col&lt;size_t&gt; samples;
</pre>
<p>I think it is better to move all temporal vectors and matrices outside (i.e. define as class members). That allows to avoid unnecessary memory allocations.</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/files/6d8976e211e46c57a11912eb8fce0ab2f891b8d3#r69545743">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFIbepFwQpYFfg6TyRr8_E6h3LLDOks5qSjxvgaJpZM4I_COp">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFM00dQZs7btQcPieYwvA4rP7axtmks5qSjxvgaJpZM4I_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/files/6d8976e211e46c57a11912eb8fce0ab2f891b8d3#r69545743"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>