<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'>> + // Z ~ N(0, 1) is p-stable.
> + projMat.randn(referenceSet->n_rows, numProj);
> + }
> + else //user-specified projection tables
> + {
> + projMat = projection[i];
> +
> + //make sure specified matrix is of correct size
> + if ( projMat.n_rows != referenceSet->n_rows )
> + throw std::invalid_argument(
> + "projection table dimensionality doesn't"
> + " equal dataset dimensionality" );
> + if ( projMat.n_cols != numProj )
> + throw std::invalid_argument(
> + "projection table doesn't have correct number of projections");
> + }
</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->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;">—<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>