<p>In <a href="https://github.com/mlpack/mlpack/pull/691#discussion_r67987466">src/mlpack/methods/lsh/lsh_search_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +    {
&gt; +      // get the perturbation set corresponding to the minimum score
&gt; +      Ai = perturbationSets[ minHeap.top().second ];
&gt; +      minHeap.pop(); // .top() returns, .pop() removes
&gt; +
&gt; +
&gt; +      // modify Ai (shift)
&gt; +      std::vector&lt;size_t&gt; As = Ai;
&gt; +      perturbationShift(As);
&gt; +      if ( perturbationValid(As, numProj) )
&gt; +      {
&gt; +        perturbationSets.push_back(As); // add shifted set to sets
&gt; +        std::pair&lt;double, size_t&gt; shifted(
&gt; +            perturbationScore(As, scores),
&gt; +            perturbationSets.size() - 1); // (score, position) pair for shift
&gt; +        minHeap.push(shifted);
</pre>
<p>Consider also using <code>make_pair</code>:</p>

<pre><code>minHeap.push(std::make_pair(perturbationScore(As, scores), perturbationSets.size() - 1));
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/691/files/fa7f62da6a4cfe7fa45e297d7a4a1491c9c39bb1#r67987466">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFByL_BRRShhKEf4zmCHnzFHmrBeGks5qOKNYgaJpZM4IxQW5">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFF9iE_uktXSDiTMS7ZOaeO3ZejlQks5qOKNYgaJpZM4IxQW5.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/mlpack/mlpack/pull/691/files/fa7f62da6a4cfe7fa45e297d7a4a1491c9c39bb1#r67987466"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>