<p>In <a href="https://github.com/mlpack/mlpack/pull/691#discussion_r68644293">src/mlpack/methods/lsh/lsh_search_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +  return false; // invalid
&gt; +}
&gt; +
&gt; +// Inline function used by GetAdditionalProbingBins. The vector expansion
&gt; +// operation adds the element [1 + (largest_element)] to a vector A, where
&gt; +// largest_element is the largest element of A. Returns true if resulting vector
&gt; +// is valid, otherwise false.
&gt; +inline bool perturbationExpand(std::vector&lt;bool&gt;&amp; A)
&gt; +{
&gt; +  // Find the last &#39;1&#39; in A
&gt; +  size_t maxPos = 0;
&gt; +  for (size_t i = 0; i &lt; A.size(); ++i)
&gt; +    if (A[i]) // marked true
&gt; +      maxPos = i;
&gt; +
&gt; +  if ( maxPos + 1 &lt; A.size()) // otherwise, this is an invalid vector
</pre>
<p><code>if (maxPos + 1 &lt; A.size())</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/71eda99e207a9b91581504e11a9e14d38838bc9f#r68644293">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFEl1co8mUtJLy_i37QrizhH-t_YMks5qQCqrgaJpZM4IxQW5">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFKL631TrSlsuN-SYjEqSvYOQgLJkks5qQCqrgaJpZM4IxQW5.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/71eda99e207a9b91581504e11a9e14d38838bc9f#r68644293"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>