<p>Do you think you can use a template specialization here to use the simple average when you can, but when you can't, use the general iterative procedure?  If you can do that, we can run some more benchmarks and commit it if the benchmarks look good. :)</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href="https://github.com/mlpack/mlpack/pull/388#issuecomment-94940591">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFG3SdlpuuUX7mvfDR07WBN6MiAJ7ks5oBrDAgaJpZM4DTzb1.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/388#issuecomment-94940591"></link>
    <meta itemprop="name" content="View Pull Request"></meta>
  </div>
  <meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>