title: Mapping Eigen Matrix Ref objects not consistent with blocks
body: <p>Quick context, I am working with another C++ library that has functions that expect either a regular or mapped Eigen matrix.  I would like to use the mapped version to avoid the memory overhead of copying.  </p>
  
  <p>That said, I am trying to work with blocks of matrices.  I know these can be easily accessed with the <code>block</code> method returning either an <code>Eigen::Block</code> or <code>Eigen::Ref</code> object.  Below I am trying to work with the <code>Ref</code> object.  I would like to <code>Map</code> the <code>Eigen::MatrixXd</code> block.  However, it appears that I cannot map across columns but only contiguous elements in columns (which I assume is a consequence of the column oriented data).  You can see the difference in outputs below.</p>
  
  <p>Is there any way for me to <code>Map</code> a block of an <code>Eigen::MatrixXd</code>?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;Eigen/Core&gt;
  
  int main()
  {
      Eigen::MatrixXd A(3,3);
      A(0,0) = 1.0;
      A(0,1) = 2.0;
      A(0,2) = 3.0;
      A(1,0) = 4.0;
      A(1,1) = 5.0;
      A(1,2) = 6.0;
      A(2,0) = 7.0;
      A(2,1) = 8.0;
      A(2,2) = 9.0;
  
      std::cout &lt;&lt; "source" &lt;&lt; std::endl;
      std::cout &lt;&lt; A &lt;&lt; std::endl;
  
      Eigen::Ref&lt;Eigen::MatrixXd&gt; block = A.block(1,1,1,2);
  
      std::cout &lt;&lt; "block" &lt;&lt; std::endl;
      std::cout &lt;&lt; block &lt;&lt; std::endl;
  
      Eigen::Map&lt;Eigen::MatrixXd&gt; map(block.data(), block.rows(), block.cols());
  
      std::cout &lt;&lt; "map" &lt;&lt; std::endl;
      std::cout &lt;&lt; map &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>source
  1 2 3
  4 5 6
  7 8 9
  
  block
  5 6
  
  map
  5 8
  </code></pre>