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

Ryan Curtin notifications at github.com
Mon Jun 27 16:01:19 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), 

It's fine to indent this after the `make_pair` is already indented, but I would go an additional four spaces in if you are going to do that.  Personally, here, I would just do this:

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

(I doubt that will line up right, but the idea is to line up `perturbationScore(As, scores)` with `perturbationSets.size() - 1`, and, no need to have an extra line to close the whole thing.

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


More information about the mlpack-git mailing list