<p>I'll move it to a cpp file. I think I originally intended the code to have some templates, but then decided against it. I figured it wasn't wrong-- but you're right about the possible linker issues. </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/issues/381#issuecomment-69796403">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFOojruoPyjtsK4kc0uhQxufMFNb0ks5nhV-zgaJpZM4DRy0T.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/issues/381#issuecomment-69796403"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>