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

Ryan Curtin notifications at github.com
Mon Jun 27 15:22:07 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;
> +    }
> +  }

I'd just pick `std::vector<bool>`, since that will pack things the same way `bitset` would, but does not have the same compile-time length requirement.

---
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#r68639241
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160627/69b12c5f/attachment.html>


More information about the mlpack-git mailing list