<p>In <a href="https://github.com/mlpack/mlpack/pull/691#discussion_r67988061">src/mlpack/methods/lsh/lsh_search_impl.hpp</a>:</p>
<pre style='color:#555'>&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 void perturbationShift(std::vector&lt;size_t&gt; &amp;A)
&gt; +{
&gt; +  size_t max_pos = 0;
&gt; +  size_t max = A[0];
&gt; +  for (size_t i = 1; i &lt; A.size(); ++i)
&gt; +  {
&gt; +    if (A[i] &gt; max)
&gt; +    {
&gt; +      max = A[i];
&gt; +      max_pos = i;
&gt; +    }
&gt; +  }
</pre>
<p>It's unfortunate that <code>std::vector</code> has to be used for <code>A</code>; if we could use Armadillo objects there then this function could be way simpler.  But after looking through the code I am not sure there is a way that we can use an Armadillo object instead of <code>std::vector</code>, since all the <code>A</code> vectors will be of different (and changing) sizes.  Correct me if I am wrong about that. :)</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/fa7f62da6a4cfe7fa45e297d7a4a1491c9c39bb1#r67988061">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFNj5LCk4yncac4CCWRs-CoHO3HL9ks5qOKWVgaJpZM4IxQW5">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFLNQ1VA9y8LytDS0s-gxbP3Uy2F-ks5qOKWVgaJpZM4IxQW5.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#r67988061"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>