<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'>&gt; +  arma::mat rdata;
&gt; +  arma::mat qdata;
&gt; +  data::Load(trainSet, rdata, true);
&gt; +  data::Load(testSet, qdata, true);
&gt; +
&gt; +  // Where to store neighbors and distances
&gt; +  arma::Mat&lt;size_t&gt; sequentialNeighbors;
&gt; +  arma::Mat&lt;size_t&gt; parallelNeighbors;
&gt; +  arma::mat distances;
&gt; +
&gt; +  // Construct an LSH object. By default, it uses the maximum number of threads
&gt; +  LSHSearch&lt;&gt; lshTest(rdata, numProj, numTables); //default parameters
&gt; +  lshTest.Search(qdata, k, parallelNeighbors, distances);
&gt; +
&gt; +  // Now perform same search but with 1 thread
&gt; +  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;">&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/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>