<p>I should also say, you won't see much speedup for a 10x10 matrix, try more like 10000 points and 100 features.  I think that you would also be benefited by looping columnwise instead:</p>

<pre><code>#pragma omp parallel for
for (size_t i = 0; i &lt; mat.n_cols; ++i)
{
  // Each threads works on a single column.
  for (size_t j = 0; j &lt; mat.n_rows; ++j)
  {
    if (mat(j, i) &lt; threshold)
      outmat(j, i) = 0;
    else
      outmat(j, i) = 1;
  }
}
</code></pre>

<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/666#issuecomment-224680700">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFNOd3W7_4L3UcRFIqxUsBTMfaIclks5qJwbogaJpZM4IsxhK">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFHcz23Etpx96h7rNmjBlViFIH19Lks5qJwbogaJpZM4IsxhK.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/666#issuecomment-224680700"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>