[mlpack-git] [mlpack/mlpack] Vantage point tree (#708)
Ryan Curtin
notifications at github.com
Thu Jul 21 19:37:25 EDT 2016
> +
> +template<typename BoundType, typename MatType>
> +void VantagePointSplit<BoundType, MatType>::
> +GetDistinctSamples(arma::uvec& distinctSamples, const size_t numSamples,
> + const size_t begin, const size_t upperBound)
> +{
> + if (upperBound > numSamples)
> + {
> + arma::Col<size_t> samples;
> +
> + samples.zeros(upperBound);
> +
> + for (size_t i = 0; i < numSamples; i++)
> + samples [ (size_t) math::RandInt(upperBound) ]++;
> +
> + distinctSamples = arma::find(samples > 0);
I think this does not guarantee that `distinctSamples.n_elem == numSamples`. Correct me if I have misunderstood.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/708/files/300882ac96e7a663e3e303ca0c45c14c6fafe1a6#r71806624
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160721/96196ab1/attachment-0001.html>
More information about the mlpack-git
mailing list