<p>In <a href="https://github.com/mlpack/mlpack/pull/708#discussion_r71805776">src/mlpack/core/tree/vantage_point_tree/vantage_point_split.hpp</a>:</p>
<pre style='color:#555'>&gt; +   */
&gt; +  static void SelectVantagePoint(const BoundType&amp; bound, const MatType&amp; data,
&gt; +    const size_t begin, const size_t count, size_t&amp; vantagePoint, ElemType&amp; mu);
&gt; +
&gt; +  /**
&gt; +   * Find no more then max(numSamples, upperBound) random samples i.e.
&gt; +   * random points that belong to the node. Each sample belongs to
&gt; +   * the interval [begin, begin + upperBound)
&gt; +   *
&gt; +   * @param distinctSamples The vector of samples indices.
&gt; +   * @param numSamples Maximum number of samples.
&gt; +   * @param begin The least index.
&gt; +   * @param upperBound The upper bound of indices.
&gt; +   */
&gt; +  static void GetDistinctSamples(arma::uvec&amp; distinctSamples,
&gt; +      const size_t numSamples, const size_t begin, const size_t upperBound);
</pre>
<p>This has a lot of similarities to <code>ObtainDistinctSamples()</code> from <code>mlpack/methods/rann/ra_util.hpp</code>.  Do you think we should take that function, combine it with this one (I think your version is more flexible), put it in <code>core/math/</code>, and refactor both pieces to use that code?</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/300882ac96e7a663e3e303ca0c45c14c6fafe1a6#r71805776">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJ4bFN0ROvS3jwzaPTQtnhiy08CeOrwIks5qYADNgaJpZM4I_COp">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFA51XAUg8lb-HOZhn_58eNu9XKppks5qYADNgaJpZM4I_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/300882ac96e7a663e3e303ca0c45c14c6fafe1a6#r71805776"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>