<p>The issue is that in <code>armadillo_bits/diskio_meat.hpp</code>, we have this bit of code:</p>

<pre><code>if( (is_float&lt;eT&gt;::value == true) || (is_double&lt;eT&gt;::value == true) )
  {
  f.setf(ios::scientific);
  f.precision(12);
  cell_width = 20;
  }
</code></pre>

<p>and this gives us no way to set the stream how we like.  Reimplementing <code>save_raw_ascii()</code> and calling our own overload is probably not a great idea because <code>ios::scientific</code> is the best way to represent arbitrary numbers...</p>

<p>One thing that we can do is to determine whether or not there are any numbers in the labels which are not integers (or very very close to integers), and in that case, we can cast the matrix to a <code>Mat&lt;size_t&gt;</code> or <code>Mat&lt;int&gt;</code> and then save that.  However, we should only do this for the case of text-file matrices (csv, tsv, txt)... otherwise, we might load an <code>arma_binary</code> matrix with packed doubles but then save it as packed ints, causing disaster later on in the user's pipeline.</p>

<p>If this is too hard, I don't think that it is the end of the world to turn the user's '1's and '0's into '1.0000000000e+00' and '0.00000000000e+00' since those are still valid number representations and will work later in the user's machine learning pipeline.  But we should try to avoid reimplementing Armadillo's save functionality, whatever it is we do choose to do.</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/650#issuecomment-222155636">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFL2741o3dwJJ6FGAIjJz5w23Tefjks5qFvq0gaJpZM4IneDD">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFEPaimdLKLBn5OlEwngLvTu0BRSEks5qFvq0gaJpZM4IneDD.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/650#issuecomment-222155636"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>