<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'>> + return score;
> +}
> +
> +// Inline function used by GetAdditionalProbingBins. The vector shift operation
> +// replaces the largest element of a vector A with (largest element) + 1.
> +inline bool perturbationShift(std::vector<bool>& A)
> +{
> + size_t maxPos = 0;
> + for (size_t i = 0; i < A.size(); ++i)
> + if (A[i] == 1) // marked true
> + maxPos=i;
> +
> + if ( maxPos + 1 < A.size()) // otherwise, this is an invalid vector
> + {
> + A[maxPos] = 0;
> + 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;">—<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>