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

Ryan Curtin notifications at github.com
Mon Jun 27 15:55:23 EDT 2016


> +  return false; // invalid
> +}
> +
> +// Inline function used by GetAdditionalProbingBins. The vector expansion
> +// operation adds the element [1 + (largest_element)] to a vector A, where
> +// largest_element is the largest element of A. Returns true if resulting vector
> +// is valid, otherwise false.
> +inline bool perturbationExpand(std::vector<bool>& A)
> +{
> +  // Find the last '1' in A
> +  size_t maxPos = 0;
> +  for (size_t i = 0; i < A.size(); ++i)
> +    if (A[i]) // marked true
> +      maxPos = i;
> +
> +  if ( maxPos + 1 < A.size()) // otherwise, this is an invalid vector

`if (maxPos + 1 < A.size())`

---
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/71eda99e207a9b91581504e11a9e14d38838bc9f#r68644293
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160627/07deab2f/attachment.html>


More information about the mlpack-git mailing list