[mlpack-git] [mlpack/mlpack] Vantage point tree (#708)

lozhnikov notifications at github.com
Fri Jul 22 03:46:02 EDT 2016


> +{
> +  std::vector<SortStruct<ElemType>> sorted(samples.n_rows);
> +
> +  for (size_t i = 0; i < samples.n_rows; i++)
> +  {
> +    sorted[i].point = samples[i];
> +    sorted[i].dist = bound.Metric().Evaluate(data.col(vantagePoint),
> +        data.col(samples[i]));
> +  }
> +
> +  //  Sort samples according to the distance to the vantage point
> +  std::sort(sorted.begin(), sorted.end(), StructComp<ElemType>);
> +
> +  //  Get the midian value
> +  mu = bound.Metric().Evaluate(data.col(vantagePoint),
> +      data.col(sorted[sorted.size() / 2].point));

I'll fix that.

---
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#r71838952
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160722/1d1ba99a/attachment.html>


More information about the mlpack-git mailing list