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

Ryan Curtin notifications at github.com
Tue Jun 21 22:52:08 EDT 2016


> +    {
> +      // get the perturbation set corresponding to the minimum score
> +      Ai = perturbationSets[ minHeap.top().second ];
> +      minHeap.pop(); // .top() returns, .pop() removes
> +
> +
> +      // modify Ai (shift)
> +      std::vector<size_t> As = Ai;
> +      perturbationShift(As);
> +      if ( perturbationValid(As, numProj) )
> +      {
> +        perturbationSets.push_back(As); // add shifted set to sets
> +        std::pair<double, size_t> shifted(
> +            perturbationScore(As, scores),
> +            perturbationSets.size() - 1); // (score, position) pair for shift
> +        minHeap.push(shifted);

Consider also using `make_pair`:

```
minHeap.push(std::make_pair(perturbationScore(As, scores), perturbationSets.size() - 1));
```

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


More information about the mlpack-git mailing list