<p>In <a href="https://github.com/mlpack/mlpack/pull/691#discussion_r68639747">src/mlpack/methods/lsh/lsh_search_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +  return score;
&gt; +}
&gt; +
&gt; +// Inline function used by GetAdditionalProbingBins. The vector shift operation
&gt; +// replaces the largest element of a vector A with (largest element) + 1.
&gt; +inline bool perturbationShift(std::vector&lt;bool&gt;&amp; A)
&gt; +{
&gt; +  size_t maxPos = 0;
&gt; +  for (size_t i = 0; i &lt; A.size(); ++i)
&gt; +    if (A[i] == 1) // marked true
&gt; +      maxPos=i;
&gt; +  
&gt; +  if ( maxPos + 1 &lt; A.size()) // otherwise, this is an invalid vector 
&gt; +  {
&gt; +    A[maxPos] = 0;
&gt; +    A[maxPos+1] = 1;
</pre>
<p>I'm going to be picky about style again, this should be <code>maxPos + 1</code>, and further up it should be <code>if (maxPos + 1</code> and above that, <code>maxPos = i</code>. :)</p>

<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/e2596c5ac626fe6264d89ec4d546506228e16d56#r68639747">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFGhhcyvVDvn2HJqnK3RXgSYp5cpOks5qQCOxgaJpZM4IxQW5">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFKdwnXVo0yvqYh56_UyV-O1pDT9vks5qQCOxgaJpZM4IxQW5.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/e2596c5ac626fe6264d89ec4d546506228e16d56#r68639747"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>