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

Ryan Curtin notifications at github.com
Tue Jun 21 23:01:41 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;
> +    }
> +  }

It's unfortunate that `std::vector` has to be used for `A`; if we could use Armadillo objects there then this function could be way simpler.  But after looking through the code I am not sure there is a way that we can use an Armadillo object instead of `std::vector`, since all the `A` vectors will be of different (and changing) sizes.  Correct me if I am wrong about 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/691/files/fa7f62da6a4cfe7fa45e297d7a4a1491c9c39bb1#r67988061
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160621/83db18cd/attachment-0001.html>


More information about the mlpack-git mailing list