[mlpack-git] [mlpack/mlpack] Implementation of Multiprobe LSH (#691)

Ryan Curtin notifications at github.com
Mon Jun 27 15:33:22 EDT 2016


> +}
> +
> +// Inline function used by GetAdditionalProbingBins. The vector shift operation
> +// replaces the largest element of a vector A with (largest element) + 1.
> +inline void perturbationShift(std::vector<size_t> &A)
> +{
> +  size_t max_pos = 0;
> +  size_t max = A[0];
> +  for (size_t i = 1; i < A.size(); ++i)
> +  {
> +    if (A[i] > max)
> +    {
> +      max = A[i];
> +      max_pos = i;
> +    }
> +  }

Ah, sorry, I didn't see a later comment of yours.  If the `std::vector<bool>` solution isn't to your liking and it doesn't give any performance change, then it's up to you which implementation you want to go with.  Personally I'd probably pick the one that gives clearer code, but which one that is is up to you.

---
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/691/files/fa7f62da6a4cfe7fa45e297d7a4a1491c9c39bb1#r68640897
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160627/9c3d2a0a/attachment.html>


More information about the mlpack-git mailing list