title: How to read an eigen matrix from a file?
body: <p>I know I can write an eigen matrix to a file like this:</p>
  
  <pre><code>  std::ofstream file("test.txt");
    if (file.is_open())
    {
      Eigen::Matrix&lt;double, 5, 1, Eigen::DontAlign&gt; m;
      m &lt;&lt; 1, 2, 3, 4, 5;
      file &lt;&lt; m;
    }
  </code></pre>
  
  <p>Whats the easiest way to read it again? This does not seem to work:</p>
  
  <pre><code>  std::ifstream file("test.txt");
    if (file.is_open())
    {
      Eigen::Matrix&lt;double, 5, 1, Eigen::DontAlign&gt; m;
      file &gt;&gt; m;
    }
  </code></pre>
  
  <p>I get the following compiler error:</p>
  
  <pre><code>error: cannot bind 'std::basic_istream&lt;char&gt;' lvalue to 'std::basic_istream&lt;char&gt;&amp;&amp;'
           file &gt;&gt; m;
  </code></pre>