<p>In <a href="https://github.com/mlpack/mlpack/pull/700#discussion_r69978737">src/mlpack/tests/lsh_test.cpp</a>:</p>
<pre style='color:#555'>> + arma::mat rdata;
> + arma::mat qdata;
> + data::Load(trainSet, rdata, true);
> + data::Load(testSet, qdata, true);
> +
> + // Where to store neighbors and distances
> + arma::Mat<size_t> sequentialNeighbors;
> + arma::Mat<size_t> parallelNeighbors;
> + arma::mat distances;
> +
> + // Construct an LSH object. By default, it uses the maximum number of threads
> + LSHSearch<> lshTest(rdata, numProj, numTables); //default parameters
> + lshTest.Search(qdata, k, parallelNeighbors, distances);
> +
> + // Now perform same search but with 1 thread
> + lshTest.MaxThreads(1);
</pre>
<p>If you did remove the <code>MaxThreads()</code> member from <code>LSHSearch</code>, you could easily replicate the same functionality by just calling <code>omp_set_num_threads(1)</code> before the second call to <code>lshTest.Search()</code>. (Maybe you would want to restore the original number of threads afterwards for other OpenMP tests.)</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/700/files/c4c8ff950be8a06e06084764f188095c650b7a60#r69978737">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFBWpXT4qhkll-22_1sq1eswA0YqQks5qTV8YgaJpZM4I5KSz">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFEm97uuq1ij6WTsikgTsKwdD4kNzks5qTV8YgaJpZM4I5KSz.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/700/files/c4c8ff950be8a06e06084764f188095c650b7a60#r69978737"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>