<p>In <a href="https://github.com/mlpack/mlpack/pull/703#discussion_r68447737">src/mlpack/methods/edge_boxes/feature_extraction_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +        HistArr(r, c, o1) += Magnitude(i, j) * (1 + (int)o - o);
&gt; +        HistArr(r, c, o2) += Magnitude(i, j) * (o - (int) o);
&gt; +      }
&gt; +      else
&gt; +      {
&gt; +        o1 = (size_t) (Orientation(i, j) / o_range + 0.5) % numOrient;
&gt; +        HistArr(r, c, o1) += Magnitude(i, j);
&gt; +      }
&gt; +    }
&gt; +  }
&gt; +
&gt; +  HistArr = HistArr / downscale;
&gt; +
&gt; +  for (size_t i = 0; i &lt; HistArr.n_slices; ++i)
&gt; +    HistArr.slice(i) = arma::square(HistArr.slice(i));
&gt; +}
</pre>
<p>arma::square works for Cube too, following should work</p>

<p><code>HistArr = arma::square(HistArr);</code></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/703/files/987f0790f745314a2117a87f28a346b05a8a2a2d#r68447737">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFBbrpRH3UrAikoyvbxHAMORmNDSGks5qPCungaJpZM4I5X__">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFElXT3fYQ5xuzFZEaJxylYtOQrVPks5qPCungaJpZM4I5X__.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/703/files/987f0790f745314a2117a87f28a346b05a8a2a2d#r68447737"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>