<p>I agree that it seems a little bit hackish, but at least in terms of runtime, checking for a failed memory allocation won't cost anything noticeable, since none of the transpose logic happens before the memory allocation.  If you can think of a better way, do that instead. :)</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/203#issuecomment-75185072">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFAPJl52wRzfN2FyBo-xiz6PvcuYYks5ntqQ7gaJpZM4DM1po.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/203#issuecomment-75185072"></link>
    <meta itemprop="name" content="View Issue"></meta>
  </div>
  <meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>