<p>In <a href="https://github.com/mlpack/mlpack/pull/683#discussion_r66475952">src/mlpack/methods/edge_boxes/feature_extraction_impl.hpp</a>:</p>
<pre style='color:#555'>&gt; +  return InImage;
&gt; +}
&gt; +
&gt; +template&lt;typename MatType, typename CubeType&gt;
&gt; +CubeType StructuredForests&lt;MatType, CubeType&gt;::
&gt; +ConvTriangle(CubeType&amp; InImage, int radius)
&gt; +{
&gt; +  if (radius == 0)
&gt; +  {
&gt; +    return InImage;
&gt; +  }
&gt; +  else if (radius &lt;= 1)
&gt; +  {
&gt; +    double p = 12.0 / radius / (radius + 2) - 2;
&gt; +    arma::vec kernel = {1 , p, 1};
&gt; +    kernel = kernel / (p + 2);
</pre>
<p><code>kernel /= (p+2);</code></p>

<p>Maybe can avoid copy, I am not sure about this part.Because armadillo may do a lot of jobs to avoid memory allocation in this casein this c</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/683/files/9d85b64c6c6bdff608331195351d09abf56cfc96#r66475952">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFMzSyy4UPq118751Vlh-Dn31XuW_ks5qKEDxgaJpZM4IvUrl">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFOJYxeQF_scX7m83Z76naJdPhi6Oks5qKEDxgaJpZM4IvUrl.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/683/files/9d85b64c6c6bdff608331195351d09abf56cfc96#r66475952"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>