<p>In <a href="https://github.com/mlpack/mlpack/pull/691#discussion_r68639460">src/mlpack/methods/lsh/lsh_search_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +      maxPos = i;
&gt; +
&gt; +  if ( maxPos + 1 &lt; A.size()) // otherwise, this is an invalid vector
&gt; +  {
&gt; +    A[maxPos+1] = 1;
&gt; +    return true;
&gt; +  }
&gt; +  return false;
&gt; +
&gt; +}
&gt; +
&gt; +// Return true if perturbation set A is valid. A perturbation set is invalid if
&gt; +// it contains two (or more) actions for the same dimension or dimensions that
&gt; +// are larger than the queryCode&#39;s dimensions.
&gt; +inline bool perturbationValid(const std::vector&lt;bool&gt;&amp; A,
&gt; +                              const size_t numProj)
</pre>
<p>Another small comment---we should name this function <code>PerturbationValid</code> (and the others should have a capital first letter too).  It might make more sense to put them inside of the <code>LSH</code> class just for the sake of organization, but whatever you want to do there is fine.</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#r68639460">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFBd4mgxAkUUOd-RhZ7xXrvWPa-GOks5qQCM5gaJpZM4IxQW5">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFDY1XoZUl-1RRhzCEoCcWIAVAEGRks5qQCM5gaJpZM4IxQW5.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#r68639460"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>