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

Yannis Mentekidis notifications at github.com
Thu Jun 23 07:15:18 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;
> +    }
> +  }

So, I was wrong in that we cannot create an arma::Row<bool>. Armadillo's smallest type is a char, which compresses more than ints but still uses 8 times as much space as we would actually need.

If we're willing to complicate the implementation a little, we could use [std::bitset](http://www.cplusplus.com/reference/bitset/bitset/).

---
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#r68217096
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160623/150dd457/attachment.html>


More information about the mlpack-git mailing list