<p>In <a href="https://github.com/mlpack/mlpack/pull/663#discussion_r65260249">src/mlpack/methods/lsh/lsh_search_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +      // Z ~ N(0, 1) is p-stable.
&gt; +      projMat.randn(referenceSet-&gt;n_rows, numProj);
&gt; +    }
&gt; +    else //user-specified projection tables
&gt; +    {
&gt; +      projMat = projection[i];
&gt; +
&gt; +      //make sure specified matrix is of correct size
&gt; +      if ( projMat.n_rows != referenceSet-&gt;n_rows )
&gt; +        throw std::invalid_argument( 
&gt; +            &quot;projection table dimensionality doesn&#39;t&quot;
&gt; +            &quot; equal dataset dimensionality&quot; );
&gt; +      if ( projMat.n_cols != numProj )
&gt; +        throw std::invalid_argument(
&gt; +            &quot;projection table doesn&#39;t have correct number of projections&quot;);
&gt; +    }
</pre>
<p>We might be able to clean this up a bit: instead of calling <code>projMat.randn()</code>, if we use a <code>cube</code> instead, we can just call <code>cube::randn(referenceSet-&gt;n_rows, numProj, numTables)</code> once at the beginning of the function, and move this entire conditional there.  Then <code>projMat</code> or <code>projections[i]</code> won't need to be touched at all here.</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/663/files/934fe082230f7d8b8f9c3e9c1fe2f9fc25ea493e#r65260249">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFIVRtOjeTZPf5kLQ4QEm223OvpNZks5qHJ9OgaJpZM4Iq6tl">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFO1wz4fpdznjBH2rUVjqDQHdDseDks5qHJ9OgaJpZM4Iq6tl.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/663/files/934fe082230f7d8b8f9c3e9c1fe2f9fc25ea493e#r65260249"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>