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

Yannis Mentekidis notifications at github.com
Tue Jun 28 06:09:40 EDT 2016


> +    std::vector<bool> Ai;
> +    do
> +    {
> +      // Get the perturbation set corresponding to the minimum score.
> +      Ai = perturbationSets[ minHeap.top().second ];
> +      minHeap.pop(); // .top() returns, .pop() removes
> +
> +      // Shift operation on Ai (replace max with max+1).
> +      std::vector<bool> As = Ai;
> +      if ( perturbationShift(As) && perturbationValid(As, numProj) )
> +        // Don't add invalid sets.
> +      {
> +        perturbationSets.push_back(As); // add shifted set to sets
> +        minHeap.push( 
> +            std::make_pair(
> +              perturbationScore(As, scores), 

I always get confused when I have too many nested functions - that's why I space it out. I changed this to
```
minHeap.push(
    std::make_pair(PerturbationScore(As, scores),
    perturbationSets.size() - 1)
    );
```

I think this way it's clear what the two parts of the pair are, but maybe that's just me. I could change it to what you suggested.

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


More information about the mlpack-git mailing list