[mlpack-git] [mlpack/mlpack] Vantage point tree (#708)
lozhnikov
notifications at github.com
Tue Jul 5 07:13:52 EDT 2016
> + // Calculate the median value of the distance from the vantage point candidate
> + // to these samples
> + GetMedian(bound, data, samples, vantagePoint, mu);
> + }
> + }
> + assert(bestSpread > 0);
> +}
> +
> +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;
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.
---
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/6d8976e211e46c57a11912eb8fce0ab2f891b8d3#r69545743
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160705/acd4a93a/attachment.html>
More information about the mlpack-git
mailing list